The GDPR Framework By Data443 - Version 1.0.42

Version Description

(4/29/2021) = FRAM-109: change [gdpr_privacy_safe] shortcode to [data443_privacy_safe] but preserve backward compatibility for now FRAM-135: 'Undefined key' seen when Consent tab is saved FRAM-136: Fix all references of undefined variables in the Data Subjects tab FRAM-137: Remove the Unnecessary save button in the 'Do Not Sell' admin tab FRAM-140: Fix read property "consent" on string at UserConsentModel line 80 FRAM-144: Undefined Variable 'notices' accessed in PrivacyToolsPageController.php FRAM-149: Remove all uses of PHP Short Tags from the code FRAM-150: Update PHP minimum required in readme.txt of all three plugins

Download this release

Release Info

Developer data443
Plugin Icon 128x128 The GDPR Framework By Data443
Version 1.0.42
Comparing to
See all releases

Code changes from version 1.0.41 to 1.0.42

Files changed (324) hide show
  1. gdpr-framework.php +4 -3
  2. readme.txt +12 -1
  3. src/Components/Consent/ConsentManager.php +9 -6
  4. src/Components/Consent/UserConsentModel.php +3 -2
  5. src/Components/DoNotSell/AdminTabDoNotSell.php +6 -0
  6. src/Components/PrivacyManager/AdminTabPrivacyManager.php +1 -1
  7. src/Components/PrivacySafe/AdminTabPrivacySafe.php +2 -2
  8. src/Components/PrivacyToolsPage/PrivacyToolsPageController.php +6 -2
  9. src/DataSubject/AdminTabDataSubject.php +5 -0
  10. src/Updater/Updater.php +5 -25
  11. vendor/autoload.php +1 -1
  12. vendor/composer/InstalledVersions.php +70 -34
  13. vendor/composer/autoload_classmap.php +76 -11
  14. vendor/composer/autoload_files.php +2 -2
  15. vendor/composer/autoload_psr4.php +4 -2
  16. vendor/composer/autoload_real.php +7 -7
  17. vendor/composer/autoload_static.php +106 -23
  18. vendor/composer/installed.json +355 -104
  19. vendor/composer/installed.php +70 -34
  20. vendor/composer/platform_check.php +2 -2
  21. vendor/doctrine/inflector/composer.json +0 -2
  22. vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php +0 -281
  23. vendor/illuminate/{support → collections}/Arr.php +132 -53
  24. vendor/illuminate/{support → collections}/Collection.php +437 -639
  25. vendor/illuminate/collections/Enumerable.php +1027 -0
  26. vendor/illuminate/{support → collections}/HigherOrderCollectionProxy.php +4 -4
  27. vendor/illuminate/collections/HigherOrderWhenProxy.php +63 -0
  28. vendor/{paragonie/random_compat/LICENSE → illuminate/collections/LICENSE.md} +5 -6
  29. vendor/illuminate/collections/LazyCollection.php +1417 -0
  30. vendor/illuminate/collections/Traits/EnumeratesValues.php +1056 -0
  31. vendor/illuminate/collections/composer.json +41 -0
  32. vendor/illuminate/collections/helpers.php +186 -0
  33. vendor/illuminate/config/LICENSE.md +21 -0
  34. vendor/illuminate/config/Repository.php +29 -4
  35. vendor/illuminate/config/composer.json +4 -4
  36. vendor/illuminate/container/BoundMethod.php +39 -17
  37. vendor/illuminate/container/Container.php +310 -117
  38. vendor/illuminate/container/ContextualBindingBuilder.php +38 -8
  39. vendor/illuminate/container/EntryNotFoundException.php +11 -0
  40. vendor/illuminate/container/LICENSE.md +21 -0
  41. vendor/illuminate/container/RewindableGenerator.php +60 -0
  42. vendor/illuminate/container/Util.php +73 -0
  43. vendor/illuminate/container/composer.json +7 -3
  44. vendor/illuminate/contracts/Auth/Access/Authorizable.php +2 -2
  45. vendor/illuminate/contracts/Auth/Access/Gate.php +49 -3
  46. vendor/illuminate/contracts/Auth/Factory.php +1 -1
  47. vendor/illuminate/contracts/Auth/Guard.php +1 -1
  48. vendor/illuminate/contracts/Auth/Middleware/AuthenticatesRequests.php +8 -0
  49. vendor/illuminate/contracts/Auth/MustVerifyEmail.php +34 -0
  50. vendor/illuminate/contracts/Auth/PasswordBroker.php +7 -22
  51. vendor/illuminate/contracts/Auth/StatefulGuard.php +4 -4
  52. vendor/illuminate/contracts/Auth/UserProvider.php +1 -1
  53. vendor/illuminate/contracts/Broadcasting/Factory.php +2 -2
  54. vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php +1 -1
  55. vendor/illuminate/contracts/Bus/Dispatcher.php +35 -0
  56. vendor/illuminate/contracts/Bus/QueueingDispatcher.php +16 -0
  57. vendor/illuminate/contracts/Cache/Factory.php +1 -1
  58. vendor/illuminate/contracts/Cache/Lock.php +44 -0
  59. vendor/illuminate/contracts/Cache/LockProvider.php +25 -0
  60. vendor/illuminate/contracts/Cache/LockTimeoutException.php +10 -0
  61. vendor/illuminate/contracts/Cache/Repository.php +27 -36
  62. vendor/illuminate/contracts/Cache/Store.php +13 -13
  63. vendor/illuminate/contracts/Config/Repository.php +3 -3
  64. vendor/illuminate/contracts/Console/Application.php +3 -2
  65. vendor/illuminate/contracts/Console/Kernel.php +19 -2
  66. vendor/illuminate/contracts/Container/BindingResolutionException.php +2 -1
  67. vendor/illuminate/contracts/Container/CircularDependencyException.php +11 -0
  68. vendor/illuminate/contracts/Container/Container.php +46 -14
  69. vendor/illuminate/contracts/Container/ContextualBindingBuilder.php +8 -0
  70. vendor/illuminate/contracts/Cookie/Factory.php +17 -13
  71. vendor/illuminate/contracts/Cookie/QueueingFactory.php +3 -1
  72. vendor/illuminate/contracts/Database/Eloquent/Castable.php +15 -0
  73. vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php +28 -0
  74. vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php +17 -0
  75. vendor/illuminate/contracts/Database/Eloquent/DeviatesCastableAttributes.php +28 -0
  76. vendor/illuminate/contracts/Database/Eloquent/SerializesCastableAttributes.php +17 -0
  77. vendor/illuminate/contracts/Database/Events/MigrationEvent.php +8 -0
  78. vendor/illuminate/contracts/Database/ModelIdentifier.php +19 -1
  79. vendor/illuminate/contracts/Debug/ExceptionHandler.php +19 -7
  80. vendor/illuminate/contracts/Encryption/Encrypter.php +6 -2
  81. vendor/illuminate/contracts/Encryption/StringEncrypter.php +26 -0
  82. vendor/illuminate/contracts/Events/Dispatcher.php +3 -3
  83. vendor/illuminate/contracts/Filesystem/Factory.php +1 -1
  84. vendor/illuminate/contracts/Filesystem/FileExistsException.php +10 -0
  85. vendor/illuminate/contracts/Filesystem/Filesystem.php +28 -5
  86. vendor/illuminate/contracts/Filesystem/LockTimeoutException.php +10 -0
  87. vendor/illuminate/contracts/Foundation/Application.php +133 -10
  88. vendor/illuminate/contracts/Foundation/CachesConfiguration.php +27 -0
  89. vendor/illuminate/contracts/Foundation/CachesRoutes.php +20 -0
  90. vendor/illuminate/contracts/Hashing/Hasher.php +11 -3
  91. vendor/illuminate/contracts/LICENSE.md +21 -0
  92. vendor/illuminate/contracts/Logging/Log.php +0 -98
  93. vendor/illuminate/contracts/Mail/Factory.php +14 -0
  94. vendor/illuminate/contracts/Mail/MailQueue.php +7 -11
  95. vendor/illuminate/contracts/Mail/Mailable.php +48 -5
  96. vendor/illuminate/contracts/Mail/Mailer.php +21 -5
  97. vendor/illuminate/contracts/Pagination/Paginator.php +15 -1
  98. vendor/illuminate/contracts/Queue/ClearableQueue.php +14 -0
  99. vendor/illuminate/contracts/Queue/Factory.php +1 -1
  100. vendor/illuminate/contracts/Queue/Job.php +65 -7
  101. vendor/illuminate/contracts/Queue/Queue.php +19 -19
  102. vendor/illuminate/contracts/Queue/QueueableCollection.php +14 -0
  103. vendor/illuminate/contracts/Queue/QueueableEntity.php +14 -0
  104. vendor/illuminate/contracts/Queue/ShouldBeEncrypted.php +8 -0
  105. vendor/illuminate/contracts/Queue/ShouldBeUnique.php +8 -0
  106. vendor/illuminate/contracts/Queue/ShouldBeUniqueUntilProcessing.php +8 -0
  107. vendor/illuminate/contracts/Redis/Connection.php +35 -0
  108. vendor/illuminate/contracts/Redis/Connector.php +25 -0
  109. vendor/illuminate/contracts/Redis/Factory.php +1 -1
  110. vendor/illuminate/contracts/Redis/LimiterTimeoutException.php +10 -0
  111. vendor/illuminate/contracts/Routing/Registrar.php +9 -9
  112. vendor/illuminate/contracts/Routing/ResponseFactory.php +40 -11
  113. vendor/illuminate/contracts/Routing/UrlGenerator.php +15 -7
  114. vendor/illuminate/contracts/Routing/UrlRoutable.php +19 -0
  115. vendor/illuminate/contracts/Session/Session.php +42 -3
  116. vendor/illuminate/contracts/Support/DeferrableProvider.php +13 -0
  117. vendor/illuminate/contracts/Support/DeferringDisplayableValue.php +13 -0
  118. vendor/illuminate/contracts/Support/MessageBag.php +18 -4
  119. vendor/illuminate/contracts/Support/Responsable.php +14 -0
  120. vendor/illuminate/contracts/Translation/HasLocalePreference.php +13 -0
  121. vendor/illuminate/contracts/Translation/Loader.php +40 -0
  122. vendor/illuminate/contracts/Translation/Translator.php +7 -7
  123. vendor/illuminate/contracts/Validation/Factory.php +4 -4
  124. vendor/illuminate/contracts/Validation/ImplicitRule.php +8 -0
  125. vendor/illuminate/contracts/Validation/Rule.php +22 -0
  126. vendor/illuminate/contracts/Validation/ValidatesWhenResolved.php +1 -1
  127. vendor/illuminate/contracts/Validation/Validator.php +27 -2
  128. vendor/illuminate/contracts/View/Engine.php +15 -0
  129. vendor/illuminate/contracts/View/Factory.php +2 -2
  130. vendor/illuminate/contracts/View/View.php +8 -1
  131. vendor/illuminate/contracts/composer.json +4 -2
  132. vendor/illuminate/filesystem/Cache.php +71 -0
  133. vendor/illuminate/filesystem/Filesystem.php +195 -43
  134. vendor/illuminate/filesystem/FilesystemAdapter.php +283 -42
  135. vendor/illuminate/filesystem/FilesystemManager.php +105 -65
  136. vendor/illuminate/filesystem/FilesystemServiceProvider.php +6 -6
  137. vendor/illuminate/filesystem/LICENSE.md +21 -0
  138. vendor/illuminate/filesystem/LockableFile.php +188 -0
  139. vendor/illuminate/filesystem/composer.json +16 -8
  140. vendor/illuminate/macroable/LICENSE.md +21 -0
  141. vendor/illuminate/macroable/Traits/Macroable.php +116 -0
  142. vendor/illuminate/macroable/composer.json +33 -0
  143. vendor/illuminate/support/Carbon.php +18 -0
  144. vendor/illuminate/support/Composer.php +25 -15
  145. vendor/illuminate/support/ConfigurationUrlParser.php +193 -0
  146. vendor/illuminate/support/DateFactory.php +231 -0
  147. vendor/illuminate/support/Debug/Dumper.php +0 -26
  148. vendor/illuminate/support/Debug/HtmlDumper.php +0 -29
  149. vendor/illuminate/support/Env.php +103 -0
  150. vendor/illuminate/support/Facades/App.php +38 -9
  151. vendor/illuminate/support/Facades/Artisan.php +5 -3
  152. vendor/illuminate/support/Facades/Auth.php +25 -11
  153. vendor/illuminate/support/Facades/Blade.php +25 -1
  154. vendor/illuminate/support/Facades/Broadcast.php +6 -0
  155. vendor/illuminate/support/Facades/Bus.php +40 -4
  156. vendor/illuminate/support/Facades/Cache.php +20 -0
  157. vendor/illuminate/support/Facades/Config.php +7 -0
  158. vendor/illuminate/support/Facades/Cookie.php +7 -3
  159. vendor/illuminate/support/Facades/Crypt.php +8 -0
  160. vendor/illuminate/support/Facades/DB.php +29 -0
  161. vendor/illuminate/support/Facades/Date.php +120 -0
  162. vendor/illuminate/support/Facades/Event.php +45 -3
  163. vendor/illuminate/support/Facades/Facade.php +47 -7
  164. vendor/illuminate/support/Facades/File.php +41 -0
  165. vendor/illuminate/support/Facades/Gate.php +17 -0
  166. vendor/illuminate/support/Facades/Hash.php +6 -1
  167. vendor/illuminate/support/Facades/Http.php +62 -0
  168. vendor/illuminate/support/Facades/Input.php +0 -33
  169. vendor/illuminate/support/Facades/Lang.php +6 -0
  170. vendor/illuminate/support/Facades/Log.php +16 -4
  171. vendor/illuminate/support/Facades/Mail.php +29 -3
  172. vendor/illuminate/support/Facades/Notification.php +29 -2
  173. vendor/illuminate/support/Facades/ParallelTesting.php +26 -0
  174. vendor/illuminate/support/Facades/Password.php +18 -7
  175. vendor/illuminate/support/Facades/Queue.php +34 -2
  176. vendor/illuminate/support/Facades/RateLimiter.php +29 -0
  177. vendor/illuminate/support/Facades/Redirect.php +16 -0
  178. vendor/illuminate/support/Facades/Redis.php +4 -0
  179. vendor/illuminate/support/Facades/Request.php +84 -0
  180. vendor/illuminate/support/Facades/Response.php +15 -0
  181. vendor/illuminate/support/Facades/Route.php +39 -15
  182. vendor/illuminate/support/Facades/Schema.php +12 -1
  183. vendor/illuminate/support/Facades/Session.php +25 -0
  184. vendor/illuminate/support/Facades/Storage.php +59 -13
  185. vendor/illuminate/support/Facades/URL.php +19 -0
  186. vendor/illuminate/support/Facades/Validator.php +6 -0
  187. vendor/illuminate/support/Facades/View.php +10 -0
  188. vendor/illuminate/support/Fluent.php +22 -22
  189. vendor/illuminate/support/HtmlString.php +21 -1
  190. vendor/illuminate/support/InteractsWithTime.php +64 -0
  191. vendor/illuminate/support/LICENSE.md +21 -0
  192. vendor/illuminate/support/Manager.php +66 -13
  193. vendor/illuminate/support/MessageBag.php +56 -23
  194. vendor/illuminate/support/NamespacedItemResolver.php +6 -10
  195. vendor/illuminate/support/Optional.php +131 -0
  196. vendor/illuminate/support/Pluralizer.php +41 -8
  197. vendor/illuminate/support/ProcessUtils.php +69 -0
  198. vendor/illuminate/support/Reflector.php +102 -0
  199. vendor/illuminate/support/ServiceProvider.php +187 -35
  200. vendor/illuminate/support/Str.php +360 -180
  201. vendor/illuminate/support/Stringable.php +813 -0
  202. vendor/illuminate/support/Testing/Fakes/BatchRepositoryFake.php +142 -0
  203. vendor/illuminate/support/Testing/Fakes/BusFake.php +511 -10
  204. vendor/illuminate/support/Testing/Fakes/EventFake.php +147 -24
  205. vendor/illuminate/support/Testing/Fakes/MailFake.php +229 -18
  206. vendor/illuminate/support/Testing/Fakes/NotificationFake.php +122 -16
  207. vendor/illuminate/support/Testing/Fakes/PendingBatchFake.php +39 -0
  208. vendor/illuminate/support/Testing/Fakes/PendingChainFake.php +56 -0
  209. vendor/illuminate/support/Testing/Fakes/PendingMailFake.php +5 -16
  210. vendor/illuminate/support/Testing/Fakes/QueueFake.php +203 -27
  211. vendor/illuminate/support/Traits/CapsuleManagerTrait.php +1 -1
  212. vendor/illuminate/support/Traits/ForwardsCalls.php +54 -0
  213. vendor/illuminate/support/Traits/Localizable.php +34 -0
  214. vendor/illuminate/support/Traits/Macroable.php +0 -83
  215. vendor/illuminate/support/Traits/ReflectsClosures.php +55 -0
  216. vendor/illuminate/support/Traits/Tappable.php +17 -0
  217. vendor/illuminate/support/ViewErrorBag.php +10 -0
  218. vendor/illuminate/support/composer.json +17 -10
  219. vendor/illuminate/support/helpers.php +135 -788
  220. vendor/paragonie/random_compat/composer.json +0 -38
  221. vendor/paragonie/random_compat/dist/random_compat.phar.pubkey +0 -5
  222. vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc +0 -11
  223. vendor/paragonie/random_compat/lib/byte_safe_strings.php +0 -195
  224. vendor/paragonie/random_compat/lib/cast_to_int.php +0 -77
  225. vendor/paragonie/random_compat/lib/error_polyfill.php +0 -49
  226. vendor/paragonie/random_compat/lib/random.php +0 -225
  227. vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php +0 -91
  228. vendor/paragonie/random_compat/lib/random_bytes_dev_urandom.php +0 -190
  229. vendor/paragonie/random_compat/lib/random_bytes_libsodium.php +0 -91
  230. vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php +0 -93
  231. vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php +0 -79
  232. vendor/paragonie/random_compat/lib/random_int.php +0 -204
  233. vendor/paragonie/random_compat/phpunit-autoload.php +0 -14
  234. vendor/psr/container/.gitignore +3 -0
  235. vendor/psr/container/LICENSE +21 -0
  236. vendor/psr/container/README.md +13 -0
  237. vendor/psr/container/composer.json +22 -0
  238. vendor/psr/container/src/ContainerExceptionInterface.php +10 -0
  239. vendor/psr/container/src/ContainerInterface.php +36 -0
  240. vendor/psr/container/src/NotFoundExceptionInterface.php +10 -0
  241. vendor/psr/simple-cache/.editorconfig +12 -0
  242. vendor/psr/simple-cache/LICENSE.md +21 -0
  243. vendor/psr/simple-cache/README.md +8 -0
  244. vendor/psr/simple-cache/composer.json +25 -0
  245. vendor/psr/simple-cache/src/CacheException.php +10 -0
  246. vendor/psr/simple-cache/src/CacheInterface.php +114 -0
  247. vendor/psr/simple-cache/src/InvalidArgumentException.php +13 -0
  248. vendor/symfony/finder/.gitignore +0 -3
  249. vendor/symfony/finder/CHANGELOG.md +24 -0
  250. vendor/symfony/finder/Comparator/Comparator.php +3 -10
  251. vendor/symfony/finder/Comparator/DateComparator.php +2 -2
  252. vendor/symfony/finder/Comparator/NumberComparator.php +2 -2
  253. vendor/symfony/finder/Exception/{ExceptionInterface.php → DirectoryNotFoundException.php} +2 -8
  254. vendor/symfony/finder/Finder.php +112 -65
  255. vendor/symfony/finder/Gitignore.php +133 -0
  256. vendor/symfony/finder/Glob.php +2 -7
  257. vendor/symfony/finder/Iterator/CustomFilterIterator.php +2 -2
  258. vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +1 -1
  259. vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +2 -2
  260. vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +4 -1
  261. vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +4 -4
  262. vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +1 -1
  263. vendor/symfony/finder/Iterator/FilenameFilterIterator.php +1 -1
  264. vendor/symfony/finder/Iterator/FilterIterator.php +0 -60
  265. vendor/symfony/finder/Iterator/LazyIterator.php +32 -0
  266. vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +8 -14
  267. vendor/symfony/finder/Iterator/PathFilterIterator.php +1 -1
  268. vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +1 -15
  269. vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +1 -1
  270. vendor/symfony/finder/Iterator/SortableIterator.php +41 -20
  271. vendor/symfony/finder/LICENSE +1 -1
  272. vendor/symfony/finder/SplFileInfo.php +8 -1
  273. vendor/symfony/finder/Tests/Comparator/ComparatorTest.php +0 -65
  274. vendor/symfony/finder/Tests/Comparator/DateComparatorTest.php +0 -64
  275. vendor/symfony/finder/Tests/Comparator/NumberComparatorTest.php +0 -108
  276. vendor/symfony/finder/Tests/FinderTest.php +0 -752
  277. vendor/symfony/finder/Tests/Fixtures/.dot/a +0 -0
  278. vendor/symfony/finder/Tests/Fixtures/.dot/b/c.neon +0 -0
  279. vendor/symfony/finder/Tests/Fixtures/.dot/b/d.neon +0 -0
  280. vendor/symfony/finder/Tests/Fixtures/A/B/C/abc.dat +0 -0
  281. vendor/symfony/finder/Tests/Fixtures/A/B/ab.dat +0 -0
  282. vendor/symfony/finder/Tests/Fixtures/A/a.dat +0 -0
  283. vendor/symfony/finder/Tests/Fixtures/copy/A/B/C/abc.dat.copy +0 -0
  284. vendor/symfony/finder/Tests/Fixtures/copy/A/B/ab.dat.copy +0 -0
  285. vendor/symfony/finder/Tests/Fixtures/copy/A/a.dat.copy +0 -0
  286. vendor/symfony/finder/Tests/Fixtures/dolor.txt +0 -2
  287. vendor/symfony/finder/Tests/Fixtures/ipsum.txt +0 -2
  288. vendor/symfony/finder/Tests/Fixtures/lorem.txt +0 -2
  289. vendor/symfony/finder/Tests/Fixtures/one/.dot +0 -1
  290. vendor/symfony/finder/Tests/Fixtures/one/a +0 -0
  291. vendor/symfony/finder/Tests/Fixtures/one/b/c.neon +0 -0
  292. vendor/symfony/finder/Tests/Fixtures/one/b/d.neon +0 -0
  293. vendor/symfony/finder/Tests/Fixtures/r+e.gex[c]a(r)s/dir/bar.dat +0 -0
  294. vendor/symfony/finder/Tests/Fixtures/with space/foo.txt +0 -0
  295. vendor/symfony/finder/Tests/GlobTest.php +0 -95
  296. vendor/symfony/finder/Tests/Iterator/CustomFilterIteratorTest.php +0 -44
  297. vendor/symfony/finder/Tests/Iterator/DateRangeFilterIteratorTest.php +0 -74
  298. vendor/symfony/finder/Tests/Iterator/DepthRangeFilterIteratorTest.php +0 -83
  299. vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php +0 -80
  300. vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php +0 -73
  301. vendor/symfony/finder/Tests/Iterator/FilecontentFilterIteratorTest.php +0 -86
  302. vendor/symfony/finder/Tests/Iterator/FilenameFilterIteratorTest.php +0 -54
  303. vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php +0 -53
  304. vendor/symfony/finder/Tests/Iterator/Iterator.php +0 -55
  305. vendor/symfony/finder/Tests/Iterator/IteratorTestCase.php +0 -93
  306. vendor/symfony/finder/Tests/Iterator/MockFileListIterator.php +0 -21
  307. vendor/symfony/finder/Tests/Iterator/MockSplFileInfo.php +0 -132
  308. vendor/symfony/finder/Tests/Iterator/MultiplePcreFilterIteratorTest.php +0 -71
  309. vendor/symfony/finder/Tests/Iterator/PathFilterIteratorTest.php +0 -82
  310. vendor/symfony/finder/Tests/Iterator/RealIteratorTestCase.php +0 -119
  311. vendor/symfony/finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php +0 -59
  312. vendor/symfony/finder/Tests/Iterator/SizeRangeFilterIteratorTest.php +0 -69
  313. vendor/symfony/finder/Tests/Iterator/SortableIteratorTest.php +0 -179
  314. vendor/symfony/finder/composer.json +2 -2
  315. vendor/symfony/finder/phpunit.xml.dist +0 -30
  316. vendor/voku/portable-ascii/CHANGELOG.md +177 -0
  317. vendor/voku/portable-ascii/LICENSE.txt +19 -0
  318. vendor/voku/portable-ascii/README.md +428 -0
  319. vendor/voku/portable-ascii/build/composer.json +5 -0
  320. vendor/voku/portable-ascii/build/docs/base.md +127 -0
  321. vendor/voku/portable-ascii/build/generate_docs.php +26 -0
  322. vendor/voku/portable-ascii/build/generate_max_key_length.php +20 -0
  323. vendor/voku/portable-ascii/composer.json +37 -0
  324. vendor/voku/portable-ascii/src/voku/helper/ASCII.php +576 -0
gdpr-framework.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: The GDPR Framework
5
  * Plugin URI: https://www.data443.com/gdpr-framework/
6
  * Description: Tools to help make your website GDPR-compliant. Fully documented, extendable and developer-friendly.
7
- * Version: 1.0.41
8
  * Author: Data443
9
  * Author URI: https://www.data443.com/
10
  * Text Domain: gdpr-framework
@@ -18,9 +18,10 @@ if (!defined('WPINC'))
18
  die;
19
  }
20
 
21
- define('GDPR_FRAMEWORK_VERSION', '1.0.41');
22
 
23
- add_shortcode( 'gdpr_privacy_safe', 'render_privacy_safe' );
 
24
 
25
  /**
26
  * Render WHMCS Seal Generator Addon Javascript
4
  * Plugin Name: The GDPR Framework
5
  * Plugin URI: https://www.data443.com/gdpr-framework/
6
  * Description: Tools to help make your website GDPR-compliant. Fully documented, extendable and developer-friendly.
7
+ * Version: 1.0.42
8
  * Author: Data443
9
  * Author URI: https://www.data443.com/
10
  * Text Domain: gdpr-framework
18
  die;
19
  }
20
 
21
+ define('GDPR_FRAMEWORK_VERSION', '1.0.42');
22
 
23
+ add_shortcode( 'gdpr_privacy_safe', 'render_privacy_safe' ); // preserve backward compatibility
24
+ add_shortcode( 'data443_privacy_safe', 'render_privacy_safe' );
25
 
26
  /**
27
  * Render WHMCS Seal Generator Addon Javascript
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Data443
3
  Tags: gdpr, compliance, security, privacy, wordpress gdpr, eu privacy directive, eu cookie law, california privacy law, privacy law, general data protection, ccpa, gdpr law
4
  Requires at least: 4.7
5
  Tested up to: 5.7
6
- Requires PHP: 5.6.33
7
  Stable tag: trunk
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -117,6 +117,17 @@ We are also planning to add other important privacy-related features missing fro
117
  5. GDPR FRAMEWORK PRIVACY TOOL
118
 
119
  == Change log ==
 
 
 
 
 
 
 
 
 
 
 
120
  = 1.0.41 (4/14/2021) =
121
  * FRAM-95: Fix the Privacy Seal to not display a broken link when the seal code is wrong.
122
  * FRAM-112: Fix the use of undefined variables.
3
  Tags: gdpr, compliance, security, privacy, wordpress gdpr, eu privacy directive, eu cookie law, california privacy law, privacy law, general data protection, ccpa, gdpr law
4
  Requires at least: 4.7
5
  Tested up to: 5.7
6
+ Requires PHP: 7.3
7
  Stable tag: trunk
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
117
  5. GDPR FRAMEWORK PRIVACY TOOL
118
 
119
  == Change log ==
120
+ = 1.0.42 (4/29/2021) =
121
+ FRAM-109: change [gdpr_privacy_safe] shortcode to [data443_privacy_safe] but
122
+ preserve backward compatibility for now
123
+ FRAM-135: 'Undefined key' seen when Consent tab is saved
124
+ FRAM-136: Fix all references of undefined variables in the Data Subjects tab
125
+ FRAM-137: Remove the Unnecessary save button in the 'Do Not Sell' admin tab
126
+ FRAM-140: Fix read property "consent" on string at UserConsentModel line 80
127
+ FRAM-144: Undefined Variable 'notices' accessed in PrivacyToolsPageController.php
128
+ FRAM-149: Remove all uses of PHP Short Tags from the code
129
+ FRAM-150: Update PHP minimum required in readme.txt of all three plugins
130
+
131
  = 1.0.41 (4/14/2021) =
132
  * FRAM-95: Fix the Privacy Seal to not display a broken link when the seal code is wrong.
133
  * FRAM-112: Fix the use of undefined variables.
src/Components/Consent/ConsentManager.php CHANGED
@@ -155,12 +155,15 @@ class ConsentManager
155
  {
156
  foreach ($savedConsentTypes as $consentType)
157
  {
158
- $this->customConsentTypes[$consentType['slug']] = [
159
- 'slug' => isset($consentType['slug']) ? $consentType['slug'] : '',
160
- 'title' => isset($consentType['title']) ? $consentType['title'] : '',
161
- 'description' => isset($consentType['description']) ? $consentType['description'] : '',
162
- 'visible' => isset($consentType['visible']) ? $consentType['visible'] : '',
163
- ];
 
 
 
164
  }
165
  }
166
  }
155
  {
156
  foreach ($savedConsentTypes as $consentType)
157
  {
158
+ /* FRAM-135 check for the slug key before the reference */
159
+ if (!empty($consentType['slug'])) {
160
+ $this->customConsentTypes[$consentType['slug']] = [
161
+ 'slug' => isset($consentType['slug']) ? $consentType['slug'] : '',
162
+ 'title' => isset($consentType['title']) ? $consentType['title'] : '',
163
+ 'description' => isset($consentType['description']) ? $consentType['description'] : '',
164
+ 'visible' => isset($consentType['visible']) ? $consentType['visible'] : '',
165
+ ];
166
+ }
167
  }
168
  }
169
  }
src/Components/Consent/UserConsentModel.php CHANGED
@@ -18,7 +18,7 @@ class UserConsentModel
18
  public $logtableName;
19
 
20
  /* @var string */
21
- public $version = '1.0.41';
22
 
23
  /* @var string */
24
  public $primaryKey = 'id';
@@ -74,10 +74,11 @@ class UserConsentModel
74
  {
75
  global $wpdb;
76
 
 
77
  return count( $wpdb->get_results( $wpdb->prepare(
78
  "SELECT * FROM {$this->tableName} WHERE email = %s AND consent = %s AND status = 1;",
79
  $email,
80
- $consent->consent
81
  ) ) );
82
 
83
  }
18
  public $logtableName;
19
 
20
  /* @var string */
21
+ public $version = GDPR_FRAMEWORK_VERSION;
22
 
23
  /* @var string */
24
  public $primaryKey = 'id';
74
  {
75
  global $wpdb;
76
 
77
+ // FRAM-140 fix invalid access: should be '$consent' not '$consent->consent'
78
  return count( $wpdb->get_results( $wpdb->prepare(
79
  "SELECT * FROM {$this->tableName} WHERE email = %s AND consent = %s AND status = 1;",
80
  $email,
81
+ $consent
82
  ) ) );
83
 
84
  }
src/Components/DoNotSell/AdminTabDoNotSell.php CHANGED
@@ -51,6 +51,12 @@ class AdminTabDoNotSell extends AdminTab {
51
  public function renderAboutHeader() {
52
  echo '<p>Place this shortcode on the page you would like to accept requests from users to not sell their information. We recommend placing the shortcode under the privacy tools shortcode on the privacy tools page.</p>';
53
  }
 
 
 
 
 
 
54
 
55
  public function shortcode() {
56
  echo "<code>[gdpr_do_not_sell_form]</code>";
51
  public function renderAboutHeader() {
52
  echo '<p>Place this shortcode on the page you would like to accept requests from users to not sell their information. We recommend placing the shortcode under the privacy tools shortcode on the privacy tools page.</p>';
53
  }
54
+
55
+ public function renderSubmitButton()
56
+ {
57
+ // FRAM-137 - remove unnecessary save button
58
+ // this overrides the placement of a save button which is not needed
59
+ }
60
 
61
  public function shortcode() {
62
  echo "<code>[gdpr_do_not_sell_form]</code>";
src/Components/PrivacyManager/AdminTabPrivacyManager.php CHANGED
@@ -14,7 +14,7 @@ class AdminTabPrivacyManager extends AdminTab
14
 
15
  public function __construct()
16
  {
17
- $this->title = _x('Privacy Manager', '(Admin)', 'gdpr-framework');
18
 
19
  add_action('gdpr/admin/action/PrivacyManager/generate', [$this, 'generatePrivacyManager']);
20
  }
14
 
15
  public function __construct()
16
  {
17
+ $this->title = _x('Global Privacy Manager', '(Admin)', 'gdpr-framework');
18
 
19
  add_action('gdpr/admin/action/PrivacyManager/generate', [$this, 'generatePrivacyManager']);
20
  }
src/Components/PrivacySafe/AdminTabPrivacySafe.php CHANGED
@@ -104,10 +104,10 @@ class AdminTabPrivacySafe extends AdminTab {
104
  echo "<input type='text' name='gdpr_privacy_safe_imagecode' placeholder='' value='" . get_option( 'gdpr_privacy_safe_imagecode' ) . "'>";
105
  }
106
  public function shortcode() {
107
- echo "<code>[gdpr_privacy_safe]</code>";
108
  }
109
  public function shortcodephp() {
110
- echo "<code>echo do_shortcode('[gdpr_privacy_safe]');</code>";
111
  }
112
  public function backlinkphp() {
113
 
104
  echo "<input type='text' name='gdpr_privacy_safe_imagecode' placeholder='' value='" . get_option( 'gdpr_privacy_safe_imagecode' ) . "'>";
105
  }
106
  public function shortcode() {
107
+ echo "<code>[data443_privacy_safe]</code>";
108
  }
109
  public function shortcodephp() {
110
+ echo "<code>echo do_shortcode('[data443_privacy_safe]');</code>";
111
  }
112
  public function backlinkphp() {
113
 
src/Components/PrivacyToolsPage/PrivacyToolsPageController.php CHANGED
@@ -83,7 +83,7 @@ class PrivacyToolsPageController {
83
  'donot-sell-form',
84
  gdpr( 'config' )->get( 'plugin.url' ) . 'assets/js/gdpr-donotsell.js',
85
  array( 'jquery' ),
86
- '1.0.0',
87
  true
88
  );
89
  wp_localize_script(
@@ -190,7 +190,11 @@ class PrivacyToolsPageController {
190
  * Render the contents of the identification form
191
  */
192
  protected function renderIdentificationForm() {
193
- $nonce = wp_create_nonce( 'gdpr/frontend/action/identify' );
 
 
 
 
194
  echo gdpr( 'view' )->render( 'privacy-tools/form-identify', compact( 'nonce', 'notices' ) );
195
  }
196
 
83
  'donot-sell-form',
84
  gdpr( 'config' )->get( 'plugin.url' ) . 'assets/js/gdpr-donotsell.js',
85
  array( 'jquery' ),
86
+ GDPR_FRAMEWORK_VERSION,
87
  true
88
  );
89
  wp_localize_script(
190
  * Render the contents of the identification form
191
  */
192
  protected function renderIdentificationForm() {
193
+ $nonce = wp_create_nonce( 'gdpr/frontend/action/identify' );
194
+ // FRAM-144 Fix reference of an undefined variable 'notices'
195
+ if (!isset($notices)) {
196
+ $notices = "NOTICES PLACEHOLDER";
197
+ }
198
  echo gdpr( 'view' )->render( 'privacy-tools/form-identify', compact( 'nonce', 'notices' ) );
199
  }
200
 
src/DataSubject/AdminTabDataSubject.php CHANGED
@@ -83,6 +83,9 @@ class AdminTabDataSubject extends AdminTab
83
  }
84
 
85
  $nonce = wp_create_nonce('gdpr/admin/action/search');
 
 
 
86
  echo gdpr('view')->render(
87
  'admin/data-subjects/search-form',
88
  compact('nonce', 'results', 'exportUrl', 'deleteUrl')
@@ -142,6 +145,8 @@ class AdminTabDataSubject extends AdminTab
142
  }
143
 
144
  $consentData = $dataSubject->getConsentData();
 
 
145
  if(gdpr('options')->get('classidocs_integration')){
146
  $ClassiDocsdata = $dataSubject->getClassiDocsdata($searched_email);
147
  }
83
  }
84
 
85
  $nonce = wp_create_nonce('gdpr/admin/action/search');
86
+ // Fram-136 - define variables before access
87
+ $exportUrl = '';
88
+ $deleteUrl = '';
89
  echo gdpr('view')->render(
90
  'admin/data-subjects/search-form',
91
  compact('nonce', 'results', 'exportUrl', 'deleteUrl')
145
  }
146
 
147
  $consentData = $dataSubject->getConsentData();
148
+ // Fram-136 - define variables before access
149
+ $ClassiDocsdata = '';
150
  if(gdpr('options')->get('classidocs_integration')){
151
  $ClassiDocsdata = $dataSubject->getClassiDocsdata($searched_email);
152
  }
src/Updater/Updater.php CHANGED
@@ -18,14 +18,8 @@ class Updater
18
  if (version_compare($currentVersion, '1.0.21', '<')) {
19
  $this->update_1_0_21();
20
  }
21
- if (version_compare($currentVersion, '1.0.39', '<')) {
22
- $this->update_1_0_39();
23
- }
24
- if (version_compare($currentVersion, '1.0.40', '<')) {
25
- $this->update_1_0_40();
26
- }
27
- if (version_compare($currentVersion, '1.0.41', '<')) {
28
- $this->update_1_0_41();
29
  }
30
  }
31
 
@@ -34,7 +28,7 @@ class Updater
34
  */
35
  public function getVersion()
36
  {
37
- return get_option('gdpr_plugin_version', '1.0.41');
38
  }
39
 
40
  /**
@@ -61,25 +55,11 @@ class Updater
61
  $model->createUserTable();
62
  update_option('gdpr_plugin_version', '1.0.21');
63
  }
64
- public function update_1_0_39()
65
- {
66
- $model = new \Codelight\GDPR\Components\Consent\UserConsentModel();
67
- $model->createUserTable();
68
- $model->createTable();
69
- update_option('gdpr_plugin_version', '1.0.39');
70
- }
71
- public function update_1_0_40()
72
- {
73
- $model = new \Codelight\GDPR\Components\Consent\UserConsentModel();
74
- $model->createUserTable();
75
- $model->createTable();
76
- update_option('gdpr_plugin_version', '1.0.40');
77
- }
78
- public function update_1_0_41()
79
  {
80
  $model = new \Codelight\GDPR\Components\Consent\UserConsentModel();
81
  $model->createUserTable();
82
  $model->createTable();
83
- update_option('gdpr_plugin_version', '1.0.41');
84
  }
85
  }
18
  if (version_compare($currentVersion, '1.0.21', '<')) {
19
  $this->update_1_0_21();
20
  }
21
+ if (version_compare($currentVersion, '1.0.42', '<')) {
22
+ $this->update_1_0_42();
 
 
 
 
 
 
23
  }
24
  }
25
 
28
  */
29
  public function getVersion()
30
  {
31
+ return get_option('gdpr_plugin_version', '1.0.42');
32
  }
33
 
34
  /**
55
  $model->createUserTable();
56
  update_option('gdpr_plugin_version', '1.0.21');
57
  }
58
+ public function update_1_0_42()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  {
60
  $model = new \Codelight\GDPR\Components\Consent\UserConsentModel();
61
  $model->createUserTable();
62
  $model->createTable();
63
+ update_option('gdpr_plugin_version', '1.0.42');
64
  }
65
  }
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit60e2ae3689c738e40bd3c5cd32d09b3f::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit685660b63662e7b4526beec066cc0ce1::getLoader();
vendor/composer/InstalledVersions.php CHANGED
@@ -25,78 +25,96 @@ class InstalledVersions
25
  private static $installed = array (
26
  'root' =>
27
  array (
28
- 'pretty_version' => '1.0.0+no-version-set',
29
- 'version' => '1.0.0.0',
30
  'aliases' =>
31
  array (
32
  ),
33
- 'reference' => NULL,
34
  'name' => '__root__',
35
  ),
36
  'versions' =>
37
  array (
38
  '__root__' =>
39
  array (
40
- 'pretty_version' => '1.0.0+no-version-set',
41
- 'version' => '1.0.0.0',
42
  'aliases' =>
43
  array (
44
  ),
45
- 'reference' => NULL,
46
  ),
47
  'doctrine/inflector' =>
48
  array (
49
- 'pretty_version' => '1.4.3',
50
- 'version' => '1.4.3.0',
51
  'aliases' =>
52
  array (
53
  ),
54
- 'reference' => '4650c8b30c753a76bf44fb2ed00117d6f367490c',
 
 
 
 
 
 
 
 
 
55
  ),
56
  'illuminate/config' =>
57
  array (
58
- 'pretty_version' => 'v5.4.36',
59
- 'version' => '5.4.36.0',
60
  'aliases' =>
61
  array (
62
  ),
63
- 'reference' => '8fe700aa596bc623d347e4578041fbda7a44c3d9',
64
  ),
65
  'illuminate/container' =>
66
  array (
67
- 'pretty_version' => 'v5.4.36',
68
- 'version' => '5.4.36.0',
69
  'aliases' =>
70
  array (
71
  ),
72
- 'reference' => 'c5b8a02a34a52c307f16922334c355c5eef725a6',
73
  ),
74
  'illuminate/contracts' =>
75
  array (
76
- 'pretty_version' => 'v5.4.36',
77
- 'version' => '5.4.36.0',
78
  'aliases' =>
79
  array (
80
  ),
81
- 'reference' => '67f642e018f3e95fb0b2ebffc206c3200391b1ab',
82
  ),
83
  'illuminate/filesystem' =>
84
  array (
85
- 'pretty_version' => 'v5.4.36',
86
- 'version' => '5.4.36.0',
87
  'aliases' =>
88
  array (
89
  ),
90
- 'reference' => 'b800a1423d06869ee5c2768eee123917f12b693e',
 
 
 
 
 
 
 
 
 
91
  ),
92
  'illuminate/support' =>
93
  array (
94
- 'pretty_version' => 'v5.4.36',
95
- 'version' => '5.4.36.0',
96
  'aliases' =>
97
  array (
98
  ),
99
- 'reference' => 'feab1d1495fd6d38970bd6c83586ba2ace8f299a',
100
  ),
101
  'nesbot/carbon' =>
102
  array (
@@ -107,23 +125,39 @@ private static $installed = array (
107
  ),
108
  'reference' => '2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4',
109
  ),
110
- 'paragonie/random_compat' =>
111
  array (
112
- 'pretty_version' => 'v2.0.19',
113
- 'version' => '2.0.19.0',
114
  'aliases' =>
115
  array (
116
  ),
117
- 'reference' => '446fc9faa5c2a9ddf65eb7121c0af7e857295241',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  ),
119
  'symfony/finder' =>
120
  array (
121
- 'pretty_version' => 'v3.4.47',
122
- 'version' => '3.4.47.0',
123
  'aliases' =>
124
  array (
125
  ),
126
- 'reference' => 'b6b6ad3db3edb1b4b1c1896b1975fb684994de6e',
127
  ),
128
  'symfony/polyfill-mbstring' =>
129
  array (
@@ -168,12 +202,14 @@ private static $installed = array (
168
  0 => '2.3',
169
  ),
170
  ),
171
- 'tightenco/collect' =>
172
  array (
173
- 'replaced' =>
 
 
174
  array (
175
- 0 => 'v5.4.36',
176
  ),
 
177
  ),
178
  ),
179
  );
25
  private static $installed = array (
26
  'root' =>
27
  array (
28
+ 'pretty_version' => 'dev-master',
29
+ 'version' => 'dev-master',
30
  'aliases' =>
31
  array (
32
  ),
33
+ 'reference' => 'c18157ed38570a3ea413e8e4717879c312c07e9f',
34
  'name' => '__root__',
35
  ),
36
  'versions' =>
37
  array (
38
  '__root__' =>
39
  array (
40
+ 'pretty_version' => 'dev-master',
41
+ 'version' => 'dev-master',
42
  'aliases' =>
43
  array (
44
  ),
45
+ 'reference' => 'c18157ed38570a3ea413e8e4717879c312c07e9f',
46
  ),
47
  'doctrine/inflector' =>
48
  array (
49
+ 'pretty_version' => '2.0.3',
50
+ 'version' => '2.0.3.0',
51
  'aliases' =>
52
  array (
53
  ),
54
+ 'reference' => '9cf661f4eb38f7c881cac67c75ea9b00bf97b210',
55
+ ),
56
+ 'illuminate/collections' =>
57
+ array (
58
+ 'pretty_version' => 'v8.36.2',
59
+ 'version' => '8.36.2.0',
60
+ 'aliases' =>
61
+ array (
62
+ ),
63
+ 'reference' => '591e31015a8b0731708c54411cb52d50a00b2bc3',
64
  ),
65
  'illuminate/config' =>
66
  array (
67
+ 'pretty_version' => 'v8.36.2',
68
+ 'version' => '8.36.2.0',
69
  'aliases' =>
70
  array (
71
  ),
72
+ 'reference' => '8441c542312b4d57220b1f942b947b6517c05008',
73
  ),
74
  'illuminate/container' =>
75
  array (
76
+ 'pretty_version' => 'v8.36.2',
77
+ 'version' => '8.36.2.0',
78
  'aliases' =>
79
  array (
80
  ),
81
+ 'reference' => '0e38ee1632d470e56aece0079e6e22d13e6bea8e',
82
  ),
83
  'illuminate/contracts' =>
84
  array (
85
+ 'pretty_version' => 'v8.36.2',
86
+ 'version' => '8.36.2.0',
87
  'aliases' =>
88
  array (
89
  ),
90
+ 'reference' => '5764f703ea8f74ced163125d810951cd5ef2b7e1',
91
  ),
92
  'illuminate/filesystem' =>
93
  array (
94
+ 'pretty_version' => 'v8.36.2',
95
+ 'version' => '8.36.2.0',
96
  'aliases' =>
97
  array (
98
  ),
99
+ 'reference' => '8ef5902052c5b3bb4a6c1c3afc399f30e7723cb8',
100
+ ),
101
+ 'illuminate/macroable' =>
102
+ array (
103
+ 'pretty_version' => 'v8.36.2',
104
+ 'version' => '8.36.2.0',
105
+ 'aliases' =>
106
+ array (
107
+ ),
108
+ 'reference' => '300aa13c086f25116b5f3cde3ca54ff5c822fb05',
109
  ),
110
  'illuminate/support' =>
111
  array (
112
+ 'pretty_version' => 'v8.36.2',
113
+ 'version' => '8.36.2.0',
114
  'aliases' =>
115
  array (
116
  ),
117
+ 'reference' => '26aa01648f348df7b7988ee911cdf98bcaae8ea1',
118
  ),
119
  'nesbot/carbon' =>
120
  array (
125
  ),
126
  'reference' => '2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4',
127
  ),
128
+ 'psr/container' =>
129
  array (
130
+ 'pretty_version' => '1.1.1',
131
+ 'version' => '1.1.1.0',
132
  'aliases' =>
133
  array (
134
  ),
135
+ 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
136
+ ),
137
+ 'psr/container-implementation' =>
138
+ array (
139
+ 'provided' =>
140
+ array (
141
+ 0 => '1.0',
142
+ ),
143
+ ),
144
+ 'psr/simple-cache' =>
145
+ array (
146
+ 'pretty_version' => '1.0.1',
147
+ 'version' => '1.0.1.0',
148
+ 'aliases' =>
149
+ array (
150
+ ),
151
+ 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
152
  ),
153
  'symfony/finder' =>
154
  array (
155
+ 'pretty_version' => 'v5.2.4',
156
+ 'version' => '5.2.4.0',
157
  'aliases' =>
158
  array (
159
  ),
160
+ 'reference' => '0d639a0943822626290d169965804f79400e6a04',
161
  ),
162
  'symfony/polyfill-mbstring' =>
163
  array (
202
  0 => '2.3',
203
  ),
204
  ),
205
+ 'voku/portable-ascii' =>
206
  array (
207
+ 'pretty_version' => '1.5.6',
208
+ 'version' => '1.5.6.0',
209
+ 'aliases' =>
210
  array (
 
211
  ),
212
+ 'reference' => '80953678b19901e5165c56752d087fc11526017c',
213
  ),
214
  ),
215
  );
vendor/composer/autoload_classmap.php CHANGED
@@ -161,7 +161,6 @@ return array(
161
  'Codelight\\GDPR\\Updater\\Updater' => $baseDir . '/src/Updater/Updater.php',
162
  'Codelight\\GDPR\\View' => $baseDir . '/src/View.php',
163
  'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
164
- 'Doctrine\\Common\\Inflector\\Inflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php',
165
  'Doctrine\\Inflector\\CachedWordInflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php',
166
  'Doctrine\\Inflector\\GenericLanguageInflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php',
167
  'Doctrine\\Inflector\\Inflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php',
@@ -207,12 +206,17 @@ return array(
207
  'Illuminate\\Container\\BoundMethod' => $vendorDir . '/illuminate/container/BoundMethod.php',
208
  'Illuminate\\Container\\Container' => $vendorDir . '/illuminate/container/Container.php',
209
  'Illuminate\\Container\\ContextualBindingBuilder' => $vendorDir . '/illuminate/container/ContextualBindingBuilder.php',
 
 
 
210
  'Illuminate\\Contracts\\Auth\\Access\\Authorizable' => $vendorDir . '/illuminate/contracts/Auth/Access/Authorizable.php',
211
  'Illuminate\\Contracts\\Auth\\Access\\Gate' => $vendorDir . '/illuminate/contracts/Auth/Access/Gate.php',
212
  'Illuminate\\Contracts\\Auth\\Authenticatable' => $vendorDir . '/illuminate/contracts/Auth/Authenticatable.php',
213
  'Illuminate\\Contracts\\Auth\\CanResetPassword' => $vendorDir . '/illuminate/contracts/Auth/CanResetPassword.php',
214
  'Illuminate\\Contracts\\Auth\\Factory' => $vendorDir . '/illuminate/contracts/Auth/Factory.php',
215
  'Illuminate\\Contracts\\Auth\\Guard' => $vendorDir . '/illuminate/contracts/Auth/Guard.php',
 
 
216
  'Illuminate\\Contracts\\Auth\\PasswordBroker' => $vendorDir . '/illuminate/contracts/Auth/PasswordBroker.php',
217
  'Illuminate\\Contracts\\Auth\\PasswordBrokerFactory' => $vendorDir . '/illuminate/contracts/Auth/PasswordBrokerFactory.php',
218
  'Illuminate\\Contracts\\Auth\\StatefulGuard' => $vendorDir . '/illuminate/contracts/Auth/StatefulGuard.php',
@@ -225,30 +229,45 @@ return array(
225
  'Illuminate\\Contracts\\Bus\\Dispatcher' => $vendorDir . '/illuminate/contracts/Bus/Dispatcher.php',
226
  'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => $vendorDir . '/illuminate/contracts/Bus/QueueingDispatcher.php',
227
  'Illuminate\\Contracts\\Cache\\Factory' => $vendorDir . '/illuminate/contracts/Cache/Factory.php',
 
 
 
228
  'Illuminate\\Contracts\\Cache\\Repository' => $vendorDir . '/illuminate/contracts/Cache/Repository.php',
229
  'Illuminate\\Contracts\\Cache\\Store' => $vendorDir . '/illuminate/contracts/Cache/Store.php',
230
  'Illuminate\\Contracts\\Config\\Repository' => $vendorDir . '/illuminate/contracts/Config/Repository.php',
231
  'Illuminate\\Contracts\\Console\\Application' => $vendorDir . '/illuminate/contracts/Console/Application.php',
232
  'Illuminate\\Contracts\\Console\\Kernel' => $vendorDir . '/illuminate/contracts/Console/Kernel.php',
233
  'Illuminate\\Contracts\\Container\\BindingResolutionException' => $vendorDir . '/illuminate/contracts/Container/BindingResolutionException.php',
 
234
  'Illuminate\\Contracts\\Container\\Container' => $vendorDir . '/illuminate/contracts/Container/Container.php',
235
  'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => $vendorDir . '/illuminate/contracts/Container/ContextualBindingBuilder.php',
236
  'Illuminate\\Contracts\\Cookie\\Factory' => $vendorDir . '/illuminate/contracts/Cookie/Factory.php',
237
  'Illuminate\\Contracts\\Cookie\\QueueingFactory' => $vendorDir . '/illuminate/contracts/Cookie/QueueingFactory.php',
 
 
 
 
 
 
238
  'Illuminate\\Contracts\\Database\\ModelIdentifier' => $vendorDir . '/illuminate/contracts/Database/ModelIdentifier.php',
239
  'Illuminate\\Contracts\\Debug\\ExceptionHandler' => $vendorDir . '/illuminate/contracts/Debug/ExceptionHandler.php',
240
  'Illuminate\\Contracts\\Encryption\\DecryptException' => $vendorDir . '/illuminate/contracts/Encryption/DecryptException.php',
241
  'Illuminate\\Contracts\\Encryption\\EncryptException' => $vendorDir . '/illuminate/contracts/Encryption/EncryptException.php',
242
  'Illuminate\\Contracts\\Encryption\\Encrypter' => $vendorDir . '/illuminate/contracts/Encryption/Encrypter.php',
 
243
  'Illuminate\\Contracts\\Events\\Dispatcher' => $vendorDir . '/illuminate/contracts/Events/Dispatcher.php',
244
  'Illuminate\\Contracts\\Filesystem\\Cloud' => $vendorDir . '/illuminate/contracts/Filesystem/Cloud.php',
245
  'Illuminate\\Contracts\\Filesystem\\Factory' => $vendorDir . '/illuminate/contracts/Filesystem/Factory.php',
 
246
  'Illuminate\\Contracts\\Filesystem\\FileNotFoundException' => $vendorDir . '/illuminate/contracts/Filesystem/FileNotFoundException.php',
247
  'Illuminate\\Contracts\\Filesystem\\Filesystem' => $vendorDir . '/illuminate/contracts/Filesystem/Filesystem.php',
 
248
  'Illuminate\\Contracts\\Foundation\\Application' => $vendorDir . '/illuminate/contracts/Foundation/Application.php',
 
 
249
  'Illuminate\\Contracts\\Hashing\\Hasher' => $vendorDir . '/illuminate/contracts/Hashing/Hasher.php',
250
  'Illuminate\\Contracts\\Http\\Kernel' => $vendorDir . '/illuminate/contracts/Http/Kernel.php',
251
- 'Illuminate\\Contracts\\Logging\\Log' => $vendorDir . '/illuminate/contracts/Logging/Log.php',
252
  'Illuminate\\Contracts\\Mail\\MailQueue' => $vendorDir . '/illuminate/contracts/Mail/MailQueue.php',
253
  'Illuminate\\Contracts\\Mail\\Mailable' => $vendorDir . '/illuminate/contracts/Mail/Mailable.php',
254
  'Illuminate\\Contracts\\Mail\\Mailer' => $vendorDir . '/illuminate/contracts/Mail/Mailer.php',
@@ -258,6 +277,7 @@ return array(
258
  'Illuminate\\Contracts\\Pagination\\Paginator' => $vendorDir . '/illuminate/contracts/Pagination/Paginator.php',
259
  'Illuminate\\Contracts\\Pipeline\\Hub' => $vendorDir . '/illuminate/contracts/Pipeline/Hub.php',
260
  'Illuminate\\Contracts\\Pipeline\\Pipeline' => $vendorDir . '/illuminate/contracts/Pipeline/Pipeline.php',
 
261
  'Illuminate\\Contracts\\Queue\\EntityNotFoundException' => $vendorDir . '/illuminate/contracts/Queue/EntityNotFoundException.php',
262
  'Illuminate\\Contracts\\Queue\\EntityResolver' => $vendorDir . '/illuminate/contracts/Queue/EntityResolver.php',
263
  'Illuminate\\Contracts\\Queue\\Factory' => $vendorDir . '/illuminate/contracts/Queue/Factory.php',
@@ -266,8 +286,14 @@ return array(
266
  'Illuminate\\Contracts\\Queue\\Queue' => $vendorDir . '/illuminate/contracts/Queue/Queue.php',
267
  'Illuminate\\Contracts\\Queue\\QueueableCollection' => $vendorDir . '/illuminate/contracts/Queue/QueueableCollection.php',
268
  'Illuminate\\Contracts\\Queue\\QueueableEntity' => $vendorDir . '/illuminate/contracts/Queue/QueueableEntity.php',
 
 
 
269
  'Illuminate\\Contracts\\Queue\\ShouldQueue' => $vendorDir . '/illuminate/contracts/Queue/ShouldQueue.php',
 
 
270
  'Illuminate\\Contracts\\Redis\\Factory' => $vendorDir . '/illuminate/contracts/Redis/Factory.php',
 
271
  'Illuminate\\Contracts\\Routing\\BindingRegistrar' => $vendorDir . '/illuminate/contracts/Routing/BindingRegistrar.php',
272
  'Illuminate\\Contracts\\Routing\\Registrar' => $vendorDir . '/illuminate/contracts/Routing/Registrar.php',
273
  'Illuminate\\Contracts\\Routing\\ResponseFactory' => $vendorDir . '/illuminate/contracts/Routing/ResponseFactory.php',
@@ -275,27 +301,40 @@ return array(
275
  'Illuminate\\Contracts\\Routing\\UrlRoutable' => $vendorDir . '/illuminate/contracts/Routing/UrlRoutable.php',
276
  'Illuminate\\Contracts\\Session\\Session' => $vendorDir . '/illuminate/contracts/Session/Session.php',
277
  'Illuminate\\Contracts\\Support\\Arrayable' => $vendorDir . '/illuminate/contracts/Support/Arrayable.php',
 
 
278
  'Illuminate\\Contracts\\Support\\Htmlable' => $vendorDir . '/illuminate/contracts/Support/Htmlable.php',
279
  'Illuminate\\Contracts\\Support\\Jsonable' => $vendorDir . '/illuminate/contracts/Support/Jsonable.php',
280
  'Illuminate\\Contracts\\Support\\MessageBag' => $vendorDir . '/illuminate/contracts/Support/MessageBag.php',
281
  'Illuminate\\Contracts\\Support\\MessageProvider' => $vendorDir . '/illuminate/contracts/Support/MessageProvider.php',
282
  'Illuminate\\Contracts\\Support\\Renderable' => $vendorDir . '/illuminate/contracts/Support/Renderable.php',
 
 
 
283
  'Illuminate\\Contracts\\Translation\\Translator' => $vendorDir . '/illuminate/contracts/Translation/Translator.php',
284
  'Illuminate\\Contracts\\Validation\\Factory' => $vendorDir . '/illuminate/contracts/Validation/Factory.php',
 
 
285
  'Illuminate\\Contracts\\Validation\\ValidatesWhenResolved' => $vendorDir . '/illuminate/contracts/Validation/ValidatesWhenResolved.php',
286
  'Illuminate\\Contracts\\Validation\\Validator' => $vendorDir . '/illuminate/contracts/Validation/Validator.php',
 
287
  'Illuminate\\Contracts\\View\\Factory' => $vendorDir . '/illuminate/contracts/View/Factory.php',
288
  'Illuminate\\Contracts\\View\\View' => $vendorDir . '/illuminate/contracts/View/View.php',
 
289
  'Illuminate\\Filesystem\\Filesystem' => $vendorDir . '/illuminate/filesystem/Filesystem.php',
290
  'Illuminate\\Filesystem\\FilesystemAdapter' => $vendorDir . '/illuminate/filesystem/FilesystemAdapter.php',
291
  'Illuminate\\Filesystem\\FilesystemManager' => $vendorDir . '/illuminate/filesystem/FilesystemManager.php',
292
  'Illuminate\\Filesystem\\FilesystemServiceProvider' => $vendorDir . '/illuminate/filesystem/FilesystemServiceProvider.php',
 
293
  'Illuminate\\Support\\AggregateServiceProvider' => $vendorDir . '/illuminate/support/AggregateServiceProvider.php',
294
- 'Illuminate\\Support\\Arr' => $vendorDir . '/illuminate/support/Arr.php',
295
- 'Illuminate\\Support\\Collection' => $vendorDir . '/illuminate/support/Collection.php',
 
296
  'Illuminate\\Support\\Composer' => $vendorDir . '/illuminate/support/Composer.php',
297
- 'Illuminate\\Support\\Debug\\Dumper' => $vendorDir . '/illuminate/support/Debug/Dumper.php',
298
- 'Illuminate\\Support\\Debug\\HtmlDumper' => $vendorDir . '/illuminate/support/Debug/HtmlDumper.php',
 
 
299
  'Illuminate\\Support\\Facades\\App' => $vendorDir . '/illuminate/support/Facades/App.php',
300
  'Illuminate\\Support\\Facades\\Artisan' => $vendorDir . '/illuminate/support/Facades/Artisan.php',
301
  'Illuminate\\Support\\Facades\\Auth' => $vendorDir . '/illuminate/support/Facades/Auth.php',
@@ -307,18 +346,21 @@ return array(
307
  'Illuminate\\Support\\Facades\\Cookie' => $vendorDir . '/illuminate/support/Facades/Cookie.php',
308
  'Illuminate\\Support\\Facades\\Crypt' => $vendorDir . '/illuminate/support/Facades/Crypt.php',
309
  'Illuminate\\Support\\Facades\\DB' => $vendorDir . '/illuminate/support/Facades/DB.php',
 
310
  'Illuminate\\Support\\Facades\\Event' => $vendorDir . '/illuminate/support/Facades/Event.php',
311
  'Illuminate\\Support\\Facades\\Facade' => $vendorDir . '/illuminate/support/Facades/Facade.php',
312
  'Illuminate\\Support\\Facades\\File' => $vendorDir . '/illuminate/support/Facades/File.php',
313
  'Illuminate\\Support\\Facades\\Gate' => $vendorDir . '/illuminate/support/Facades/Gate.php',
314
  'Illuminate\\Support\\Facades\\Hash' => $vendorDir . '/illuminate/support/Facades/Hash.php',
315
- 'Illuminate\\Support\\Facades\\Input' => $vendorDir . '/illuminate/support/Facades/Input.php',
316
  'Illuminate\\Support\\Facades\\Lang' => $vendorDir . '/illuminate/support/Facades/Lang.php',
317
  'Illuminate\\Support\\Facades\\Log' => $vendorDir . '/illuminate/support/Facades/Log.php',
318
  'Illuminate\\Support\\Facades\\Mail' => $vendorDir . '/illuminate/support/Facades/Mail.php',
319
  'Illuminate\\Support\\Facades\\Notification' => $vendorDir . '/illuminate/support/Facades/Notification.php',
 
320
  'Illuminate\\Support\\Facades\\Password' => $vendorDir . '/illuminate/support/Facades/Password.php',
321
  'Illuminate\\Support\\Facades\\Queue' => $vendorDir . '/illuminate/support/Facades/Queue.php',
 
322
  'Illuminate\\Support\\Facades\\Redirect' => $vendorDir . '/illuminate/support/Facades/Redirect.php',
323
  'Illuminate\\Support\\Facades\\Redis' => $vendorDir . '/illuminate/support/Facades/Redis.php',
324
  'Illuminate\\Support\\Facades\\Request' => $vendorDir . '/illuminate/support/Facades/Request.php',
@@ -331,31 +373,53 @@ return array(
331
  'Illuminate\\Support\\Facades\\Validator' => $vendorDir . '/illuminate/support/Facades/Validator.php',
332
  'Illuminate\\Support\\Facades\\View' => $vendorDir . '/illuminate/support/Facades/View.php',
333
  'Illuminate\\Support\\Fluent' => $vendorDir . '/illuminate/support/Fluent.php',
334
- 'Illuminate\\Support\\HigherOrderCollectionProxy' => $vendorDir . '/illuminate/support/HigherOrderCollectionProxy.php',
335
  'Illuminate\\Support\\HigherOrderTapProxy' => $vendorDir . '/illuminate/support/HigherOrderTapProxy.php',
 
336
  'Illuminate\\Support\\HtmlString' => $vendorDir . '/illuminate/support/HtmlString.php',
 
 
337
  'Illuminate\\Support\\Manager' => $vendorDir . '/illuminate/support/Manager.php',
338
  'Illuminate\\Support\\MessageBag' => $vendorDir . '/illuminate/support/MessageBag.php',
339
  'Illuminate\\Support\\NamespacedItemResolver' => $vendorDir . '/illuminate/support/NamespacedItemResolver.php',
 
340
  'Illuminate\\Support\\Pluralizer' => $vendorDir . '/illuminate/support/Pluralizer.php',
 
 
341
  'Illuminate\\Support\\ServiceProvider' => $vendorDir . '/illuminate/support/ServiceProvider.php',
342
  'Illuminate\\Support\\Str' => $vendorDir . '/illuminate/support/Str.php',
 
 
343
  'Illuminate\\Support\\Testing\\Fakes\\BusFake' => $vendorDir . '/illuminate/support/Testing/Fakes/BusFake.php',
344
  'Illuminate\\Support\\Testing\\Fakes\\EventFake' => $vendorDir . '/illuminate/support/Testing/Fakes/EventFake.php',
345
  'Illuminate\\Support\\Testing\\Fakes\\MailFake' => $vendorDir . '/illuminate/support/Testing/Fakes/MailFake.php',
346
  'Illuminate\\Support\\Testing\\Fakes\\NotificationFake' => $vendorDir . '/illuminate/support/Testing/Fakes/NotificationFake.php',
 
 
347
  'Illuminate\\Support\\Testing\\Fakes\\PendingMailFake' => $vendorDir . '/illuminate/support/Testing/Fakes/PendingMailFake.php',
348
  'Illuminate\\Support\\Testing\\Fakes\\QueueFake' => $vendorDir . '/illuminate/support/Testing/Fakes/QueueFake.php',
349
  'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => $vendorDir . '/illuminate/support/Traits/CapsuleManagerTrait.php',
350
- 'Illuminate\\Support\\Traits\\Macroable' => $vendorDir . '/illuminate/support/Traits/Macroable.php',
 
 
 
 
 
351
  'Illuminate\\Support\\ViewErrorBag' => $vendorDir . '/illuminate/support/ViewErrorBag.php',
 
 
 
 
 
 
352
  'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
353
  'Symfony\\Component\\Finder\\Comparator\\Comparator' => $vendorDir . '/symfony/finder/Comparator/Comparator.php',
354
  'Symfony\\Component\\Finder\\Comparator\\DateComparator' => $vendorDir . '/symfony/finder/Comparator/DateComparator.php',
355
  'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => $vendorDir . '/symfony/finder/Comparator/NumberComparator.php',
356
  'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => $vendorDir . '/symfony/finder/Exception/AccessDeniedException.php',
357
- 'Symfony\\Component\\Finder\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/finder/Exception/ExceptionInterface.php',
358
  'Symfony\\Component\\Finder\\Finder' => $vendorDir . '/symfony/finder/Finder.php',
 
359
  'Symfony\\Component\\Finder\\Glob' => $vendorDir . '/symfony/finder/Glob.php',
360
  'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => $vendorDir . '/symfony/finder/Iterator/CustomFilterIterator.php',
361
  'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DateRangeFilterIterator.php',
@@ -364,7 +428,7 @@ return array(
364
  'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FileTypeFilterIterator.php',
365
  'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilecontentFilterIterator.php',
366
  'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilenameFilterIterator.php',
367
- 'Symfony\\Component\\Finder\\Iterator\\FilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilterIterator.php',
368
  'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => $vendorDir . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php',
369
  'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => $vendorDir . '/symfony/finder/Iterator/PathFilterIterator.php',
370
  'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => $vendorDir . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php',
@@ -448,4 +512,5 @@ return array(
448
  'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php',
449
  'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
450
  'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
 
451
  );
161
  'Codelight\\GDPR\\Updater\\Updater' => $baseDir . '/src/Updater/Updater.php',
162
  'Codelight\\GDPR\\View' => $baseDir . '/src/View.php',
163
  'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
 
164
  'Doctrine\\Inflector\\CachedWordInflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php',
165
  'Doctrine\\Inflector\\GenericLanguageInflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php',
166
  'Doctrine\\Inflector\\Inflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php',
206
  'Illuminate\\Container\\BoundMethod' => $vendorDir . '/illuminate/container/BoundMethod.php',
207
  'Illuminate\\Container\\Container' => $vendorDir . '/illuminate/container/Container.php',
208
  'Illuminate\\Container\\ContextualBindingBuilder' => $vendorDir . '/illuminate/container/ContextualBindingBuilder.php',
209
+ 'Illuminate\\Container\\EntryNotFoundException' => $vendorDir . '/illuminate/container/EntryNotFoundException.php',
210
+ 'Illuminate\\Container\\RewindableGenerator' => $vendorDir . '/illuminate/container/RewindableGenerator.php',
211
+ 'Illuminate\\Container\\Util' => $vendorDir . '/illuminate/container/Util.php',
212
  'Illuminate\\Contracts\\Auth\\Access\\Authorizable' => $vendorDir . '/illuminate/contracts/Auth/Access/Authorizable.php',
213
  'Illuminate\\Contracts\\Auth\\Access\\Gate' => $vendorDir . '/illuminate/contracts/Auth/Access/Gate.php',
214
  'Illuminate\\Contracts\\Auth\\Authenticatable' => $vendorDir . '/illuminate/contracts/Auth/Authenticatable.php',
215
  'Illuminate\\Contracts\\Auth\\CanResetPassword' => $vendorDir . '/illuminate/contracts/Auth/CanResetPassword.php',
216
  'Illuminate\\Contracts\\Auth\\Factory' => $vendorDir . '/illuminate/contracts/Auth/Factory.php',
217
  'Illuminate\\Contracts\\Auth\\Guard' => $vendorDir . '/illuminate/contracts/Auth/Guard.php',
218
+ 'Illuminate\\Contracts\\Auth\\Middleware\\AuthenticatesRequests' => $vendorDir . '/illuminate/contracts/Auth/Middleware/AuthenticatesRequests.php',
219
+ 'Illuminate\\Contracts\\Auth\\MustVerifyEmail' => $vendorDir . '/illuminate/contracts/Auth/MustVerifyEmail.php',
220
  'Illuminate\\Contracts\\Auth\\PasswordBroker' => $vendorDir . '/illuminate/contracts/Auth/PasswordBroker.php',
221
  'Illuminate\\Contracts\\Auth\\PasswordBrokerFactory' => $vendorDir . '/illuminate/contracts/Auth/PasswordBrokerFactory.php',
222
  'Illuminate\\Contracts\\Auth\\StatefulGuard' => $vendorDir . '/illuminate/contracts/Auth/StatefulGuard.php',
229
  'Illuminate\\Contracts\\Bus\\Dispatcher' => $vendorDir . '/illuminate/contracts/Bus/Dispatcher.php',
230
  'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => $vendorDir . '/illuminate/contracts/Bus/QueueingDispatcher.php',
231
  'Illuminate\\Contracts\\Cache\\Factory' => $vendorDir . '/illuminate/contracts/Cache/Factory.php',
232
+ 'Illuminate\\Contracts\\Cache\\Lock' => $vendorDir . '/illuminate/contracts/Cache/Lock.php',
233
+ 'Illuminate\\Contracts\\Cache\\LockProvider' => $vendorDir . '/illuminate/contracts/Cache/LockProvider.php',
234
+ 'Illuminate\\Contracts\\Cache\\LockTimeoutException' => $vendorDir . '/illuminate/contracts/Cache/LockTimeoutException.php',
235
  'Illuminate\\Contracts\\Cache\\Repository' => $vendorDir . '/illuminate/contracts/Cache/Repository.php',
236
  'Illuminate\\Contracts\\Cache\\Store' => $vendorDir . '/illuminate/contracts/Cache/Store.php',
237
  'Illuminate\\Contracts\\Config\\Repository' => $vendorDir . '/illuminate/contracts/Config/Repository.php',
238
  'Illuminate\\Contracts\\Console\\Application' => $vendorDir . '/illuminate/contracts/Console/Application.php',
239
  'Illuminate\\Contracts\\Console\\Kernel' => $vendorDir . '/illuminate/contracts/Console/Kernel.php',
240
  'Illuminate\\Contracts\\Container\\BindingResolutionException' => $vendorDir . '/illuminate/contracts/Container/BindingResolutionException.php',
241
+ 'Illuminate\\Contracts\\Container\\CircularDependencyException' => $vendorDir . '/illuminate/contracts/Container/CircularDependencyException.php',
242
  'Illuminate\\Contracts\\Container\\Container' => $vendorDir . '/illuminate/contracts/Container/Container.php',
243
  'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => $vendorDir . '/illuminate/contracts/Container/ContextualBindingBuilder.php',
244
  'Illuminate\\Contracts\\Cookie\\Factory' => $vendorDir . '/illuminate/contracts/Cookie/Factory.php',
245
  'Illuminate\\Contracts\\Cookie\\QueueingFactory' => $vendorDir . '/illuminate/contracts/Cookie/QueueingFactory.php',
246
+ 'Illuminate\\Contracts\\Database\\Eloquent\\Castable' => $vendorDir . '/illuminate/contracts/Database/Eloquent/Castable.php',
247
+ 'Illuminate\\Contracts\\Database\\Eloquent\\CastsAttributes' => $vendorDir . '/illuminate/contracts/Database/Eloquent/CastsAttributes.php',
248
+ 'Illuminate\\Contracts\\Database\\Eloquent\\CastsInboundAttributes' => $vendorDir . '/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php',
249
+ 'Illuminate\\Contracts\\Database\\Eloquent\\DeviatesCastableAttributes' => $vendorDir . '/illuminate/contracts/Database/Eloquent/DeviatesCastableAttributes.php',
250
+ 'Illuminate\\Contracts\\Database\\Eloquent\\SerializesCastableAttributes' => $vendorDir . '/illuminate/contracts/Database/Eloquent/SerializesCastableAttributes.php',
251
+ 'Illuminate\\Contracts\\Database\\Events\\MigrationEvent' => $vendorDir . '/illuminate/contracts/Database/Events/MigrationEvent.php',
252
  'Illuminate\\Contracts\\Database\\ModelIdentifier' => $vendorDir . '/illuminate/contracts/Database/ModelIdentifier.php',
253
  'Illuminate\\Contracts\\Debug\\ExceptionHandler' => $vendorDir . '/illuminate/contracts/Debug/ExceptionHandler.php',
254
  'Illuminate\\Contracts\\Encryption\\DecryptException' => $vendorDir . '/illuminate/contracts/Encryption/DecryptException.php',
255
  'Illuminate\\Contracts\\Encryption\\EncryptException' => $vendorDir . '/illuminate/contracts/Encryption/EncryptException.php',
256
  'Illuminate\\Contracts\\Encryption\\Encrypter' => $vendorDir . '/illuminate/contracts/Encryption/Encrypter.php',
257
+ 'Illuminate\\Contracts\\Encryption\\StringEncrypter' => $vendorDir . '/illuminate/contracts/Encryption/StringEncrypter.php',
258
  'Illuminate\\Contracts\\Events\\Dispatcher' => $vendorDir . '/illuminate/contracts/Events/Dispatcher.php',
259
  'Illuminate\\Contracts\\Filesystem\\Cloud' => $vendorDir . '/illuminate/contracts/Filesystem/Cloud.php',
260
  'Illuminate\\Contracts\\Filesystem\\Factory' => $vendorDir . '/illuminate/contracts/Filesystem/Factory.php',
261
+ 'Illuminate\\Contracts\\Filesystem\\FileExistsException' => $vendorDir . '/illuminate/contracts/Filesystem/FileExistsException.php',
262
  'Illuminate\\Contracts\\Filesystem\\FileNotFoundException' => $vendorDir . '/illuminate/contracts/Filesystem/FileNotFoundException.php',
263
  'Illuminate\\Contracts\\Filesystem\\Filesystem' => $vendorDir . '/illuminate/contracts/Filesystem/Filesystem.php',
264
+ 'Illuminate\\Contracts\\Filesystem\\LockTimeoutException' => $vendorDir . '/illuminate/contracts/Filesystem/LockTimeoutException.php',
265
  'Illuminate\\Contracts\\Foundation\\Application' => $vendorDir . '/illuminate/contracts/Foundation/Application.php',
266
+ 'Illuminate\\Contracts\\Foundation\\CachesConfiguration' => $vendorDir . '/illuminate/contracts/Foundation/CachesConfiguration.php',
267
+ 'Illuminate\\Contracts\\Foundation\\CachesRoutes' => $vendorDir . '/illuminate/contracts/Foundation/CachesRoutes.php',
268
  'Illuminate\\Contracts\\Hashing\\Hasher' => $vendorDir . '/illuminate/contracts/Hashing/Hasher.php',
269
  'Illuminate\\Contracts\\Http\\Kernel' => $vendorDir . '/illuminate/contracts/Http/Kernel.php',
270
+ 'Illuminate\\Contracts\\Mail\\Factory' => $vendorDir . '/illuminate/contracts/Mail/Factory.php',
271
  'Illuminate\\Contracts\\Mail\\MailQueue' => $vendorDir . '/illuminate/contracts/Mail/MailQueue.php',
272
  'Illuminate\\Contracts\\Mail\\Mailable' => $vendorDir . '/illuminate/contracts/Mail/Mailable.php',
273
  'Illuminate\\Contracts\\Mail\\Mailer' => $vendorDir . '/illuminate/contracts/Mail/Mailer.php',
277
  'Illuminate\\Contracts\\Pagination\\Paginator' => $vendorDir . '/illuminate/contracts/Pagination/Paginator.php',
278
  'Illuminate\\Contracts\\Pipeline\\Hub' => $vendorDir . '/illuminate/contracts/Pipeline/Hub.php',
279
  'Illuminate\\Contracts\\Pipeline\\Pipeline' => $vendorDir . '/illuminate/contracts/Pipeline/Pipeline.php',
280
+ 'Illuminate\\Contracts\\Queue\\ClearableQueue' => $vendorDir . '/illuminate/contracts/Queue/ClearableQueue.php',
281
  'Illuminate\\Contracts\\Queue\\EntityNotFoundException' => $vendorDir . '/illuminate/contracts/Queue/EntityNotFoundException.php',
282
  'Illuminate\\Contracts\\Queue\\EntityResolver' => $vendorDir . '/illuminate/contracts/Queue/EntityResolver.php',
283
  'Illuminate\\Contracts\\Queue\\Factory' => $vendorDir . '/illuminate/contracts/Queue/Factory.php',
286
  'Illuminate\\Contracts\\Queue\\Queue' => $vendorDir . '/illuminate/contracts/Queue/Queue.php',
287
  'Illuminate\\Contracts\\Queue\\QueueableCollection' => $vendorDir . '/illuminate/contracts/Queue/QueueableCollection.php',
288
  'Illuminate\\Contracts\\Queue\\QueueableEntity' => $vendorDir . '/illuminate/contracts/Queue/QueueableEntity.php',
289
+ 'Illuminate\\Contracts\\Queue\\ShouldBeEncrypted' => $vendorDir . '/illuminate/contracts/Queue/ShouldBeEncrypted.php',
290
+ 'Illuminate\\Contracts\\Queue\\ShouldBeUnique' => $vendorDir . '/illuminate/contracts/Queue/ShouldBeUnique.php',
291
+ 'Illuminate\\Contracts\\Queue\\ShouldBeUniqueUntilProcessing' => $vendorDir . '/illuminate/contracts/Queue/ShouldBeUniqueUntilProcessing.php',
292
  'Illuminate\\Contracts\\Queue\\ShouldQueue' => $vendorDir . '/illuminate/contracts/Queue/ShouldQueue.php',
293
+ 'Illuminate\\Contracts\\Redis\\Connection' => $vendorDir . '/illuminate/contracts/Redis/Connection.php',
294
+ 'Illuminate\\Contracts\\Redis\\Connector' => $vendorDir . '/illuminate/contracts/Redis/Connector.php',
295
  'Illuminate\\Contracts\\Redis\\Factory' => $vendorDir . '/illuminate/contracts/Redis/Factory.php',
296
+ 'Illuminate\\Contracts\\Redis\\LimiterTimeoutException' => $vendorDir . '/illuminate/contracts/Redis/LimiterTimeoutException.php',
297
  'Illuminate\\Contracts\\Routing\\BindingRegistrar' => $vendorDir . '/illuminate/contracts/Routing/BindingRegistrar.php',
298
  'Illuminate\\Contracts\\Routing\\Registrar' => $vendorDir . '/illuminate/contracts/Routing/Registrar.php',
299
  'Illuminate\\Contracts\\Routing\\ResponseFactory' => $vendorDir . '/illuminate/contracts/Routing/ResponseFactory.php',
301
  'Illuminate\\Contracts\\Routing\\UrlRoutable' => $vendorDir . '/illuminate/contracts/Routing/UrlRoutable.php',
302
  'Illuminate\\Contracts\\Session\\Session' => $vendorDir . '/illuminate/contracts/Session/Session.php',
303
  'Illuminate\\Contracts\\Support\\Arrayable' => $vendorDir . '/illuminate/contracts/Support/Arrayable.php',
304
+ 'Illuminate\\Contracts\\Support\\DeferrableProvider' => $vendorDir . '/illuminate/contracts/Support/DeferrableProvider.php',
305
+ 'Illuminate\\Contracts\\Support\\DeferringDisplayableValue' => $vendorDir . '/illuminate/contracts/Support/DeferringDisplayableValue.php',
306
  'Illuminate\\Contracts\\Support\\Htmlable' => $vendorDir . '/illuminate/contracts/Support/Htmlable.php',
307
  'Illuminate\\Contracts\\Support\\Jsonable' => $vendorDir . '/illuminate/contracts/Support/Jsonable.php',
308
  'Illuminate\\Contracts\\Support\\MessageBag' => $vendorDir . '/illuminate/contracts/Support/MessageBag.php',
309
  'Illuminate\\Contracts\\Support\\MessageProvider' => $vendorDir . '/illuminate/contracts/Support/MessageProvider.php',
310
  'Illuminate\\Contracts\\Support\\Renderable' => $vendorDir . '/illuminate/contracts/Support/Renderable.php',
311
+ 'Illuminate\\Contracts\\Support\\Responsable' => $vendorDir . '/illuminate/contracts/Support/Responsable.php',
312
+ 'Illuminate\\Contracts\\Translation\\HasLocalePreference' => $vendorDir . '/illuminate/contracts/Translation/HasLocalePreference.php',
313
+ 'Illuminate\\Contracts\\Translation\\Loader' => $vendorDir . '/illuminate/contracts/Translation/Loader.php',
314
  'Illuminate\\Contracts\\Translation\\Translator' => $vendorDir . '/illuminate/contracts/Translation/Translator.php',
315
  'Illuminate\\Contracts\\Validation\\Factory' => $vendorDir . '/illuminate/contracts/Validation/Factory.php',
316
+ 'Illuminate\\Contracts\\Validation\\ImplicitRule' => $vendorDir . '/illuminate/contracts/Validation/ImplicitRule.php',
317
+ 'Illuminate\\Contracts\\Validation\\Rule' => $vendorDir . '/illuminate/contracts/Validation/Rule.php',
318
  'Illuminate\\Contracts\\Validation\\ValidatesWhenResolved' => $vendorDir . '/illuminate/contracts/Validation/ValidatesWhenResolved.php',
319
  'Illuminate\\Contracts\\Validation\\Validator' => $vendorDir . '/illuminate/contracts/Validation/Validator.php',
320
+ 'Illuminate\\Contracts\\View\\Engine' => $vendorDir . '/illuminate/contracts/View/Engine.php',
321
  'Illuminate\\Contracts\\View\\Factory' => $vendorDir . '/illuminate/contracts/View/Factory.php',
322
  'Illuminate\\Contracts\\View\\View' => $vendorDir . '/illuminate/contracts/View/View.php',
323
+ 'Illuminate\\Filesystem\\Cache' => $vendorDir . '/illuminate/filesystem/Cache.php',
324
  'Illuminate\\Filesystem\\Filesystem' => $vendorDir . '/illuminate/filesystem/Filesystem.php',
325
  'Illuminate\\Filesystem\\FilesystemAdapter' => $vendorDir . '/illuminate/filesystem/FilesystemAdapter.php',
326
  'Illuminate\\Filesystem\\FilesystemManager' => $vendorDir . '/illuminate/filesystem/FilesystemManager.php',
327
  'Illuminate\\Filesystem\\FilesystemServiceProvider' => $vendorDir . '/illuminate/filesystem/FilesystemServiceProvider.php',
328
+ 'Illuminate\\Filesystem\\LockableFile' => $vendorDir . '/illuminate/filesystem/LockableFile.php',
329
  'Illuminate\\Support\\AggregateServiceProvider' => $vendorDir . '/illuminate/support/AggregateServiceProvider.php',
330
+ 'Illuminate\\Support\\Arr' => $vendorDir . '/illuminate/collections/Arr.php',
331
+ 'Illuminate\\Support\\Carbon' => $vendorDir . '/illuminate/support/Carbon.php',
332
+ 'Illuminate\\Support\\Collection' => $vendorDir . '/illuminate/collections/Collection.php',
333
  'Illuminate\\Support\\Composer' => $vendorDir . '/illuminate/support/Composer.php',
334
+ 'Illuminate\\Support\\ConfigurationUrlParser' => $vendorDir . '/illuminate/support/ConfigurationUrlParser.php',
335
+ 'Illuminate\\Support\\DateFactory' => $vendorDir . '/illuminate/support/DateFactory.php',
336
+ 'Illuminate\\Support\\Enumerable' => $vendorDir . '/illuminate/collections/Enumerable.php',
337
+ 'Illuminate\\Support\\Env' => $vendorDir . '/illuminate/support/Env.php',
338
  'Illuminate\\Support\\Facades\\App' => $vendorDir . '/illuminate/support/Facades/App.php',
339
  'Illuminate\\Support\\Facades\\Artisan' => $vendorDir . '/illuminate/support/Facades/Artisan.php',
340
  'Illuminate\\Support\\Facades\\Auth' => $vendorDir . '/illuminate/support/Facades/Auth.php',
346
  'Illuminate\\Support\\Facades\\Cookie' => $vendorDir . '/illuminate/support/Facades/Cookie.php',
347
  'Illuminate\\Support\\Facades\\Crypt' => $vendorDir . '/illuminate/support/Facades/Crypt.php',
348
  'Illuminate\\Support\\Facades\\DB' => $vendorDir . '/illuminate/support/Facades/DB.php',
349
+ 'Illuminate\\Support\\Facades\\Date' => $vendorDir . '/illuminate/support/Facades/Date.php',
350
  'Illuminate\\Support\\Facades\\Event' => $vendorDir . '/illuminate/support/Facades/Event.php',
351
  'Illuminate\\Support\\Facades\\Facade' => $vendorDir . '/illuminate/support/Facades/Facade.php',
352
  'Illuminate\\Support\\Facades\\File' => $vendorDir . '/illuminate/support/Facades/File.php',
353
  'Illuminate\\Support\\Facades\\Gate' => $vendorDir . '/illuminate/support/Facades/Gate.php',
354
  'Illuminate\\Support\\Facades\\Hash' => $vendorDir . '/illuminate/support/Facades/Hash.php',
355
+ 'Illuminate\\Support\\Facades\\Http' => $vendorDir . '/illuminate/support/Facades/Http.php',
356
  'Illuminate\\Support\\Facades\\Lang' => $vendorDir . '/illuminate/support/Facades/Lang.php',
357
  'Illuminate\\Support\\Facades\\Log' => $vendorDir . '/illuminate/support/Facades/Log.php',
358
  'Illuminate\\Support\\Facades\\Mail' => $vendorDir . '/illuminate/support/Facades/Mail.php',
359
  'Illuminate\\Support\\Facades\\Notification' => $vendorDir . '/illuminate/support/Facades/Notification.php',
360
+ 'Illuminate\\Support\\Facades\\ParallelTesting' => $vendorDir . '/illuminate/support/Facades/ParallelTesting.php',
361
  'Illuminate\\Support\\Facades\\Password' => $vendorDir . '/illuminate/support/Facades/Password.php',
362
  'Illuminate\\Support\\Facades\\Queue' => $vendorDir . '/illuminate/support/Facades/Queue.php',
363
+ 'Illuminate\\Support\\Facades\\RateLimiter' => $vendorDir . '/illuminate/support/Facades/RateLimiter.php',
364
  'Illuminate\\Support\\Facades\\Redirect' => $vendorDir . '/illuminate/support/Facades/Redirect.php',
365
  'Illuminate\\Support\\Facades\\Redis' => $vendorDir . '/illuminate/support/Facades/Redis.php',
366
  'Illuminate\\Support\\Facades\\Request' => $vendorDir . '/illuminate/support/Facades/Request.php',
373
  'Illuminate\\Support\\Facades\\Validator' => $vendorDir . '/illuminate/support/Facades/Validator.php',
374
  'Illuminate\\Support\\Facades\\View' => $vendorDir . '/illuminate/support/Facades/View.php',
375
  'Illuminate\\Support\\Fluent' => $vendorDir . '/illuminate/support/Fluent.php',
376
+ 'Illuminate\\Support\\HigherOrderCollectionProxy' => $vendorDir . '/illuminate/collections/HigherOrderCollectionProxy.php',
377
  'Illuminate\\Support\\HigherOrderTapProxy' => $vendorDir . '/illuminate/support/HigherOrderTapProxy.php',
378
+ 'Illuminate\\Support\\HigherOrderWhenProxy' => $vendorDir . '/illuminate/collections/HigherOrderWhenProxy.php',
379
  'Illuminate\\Support\\HtmlString' => $vendorDir . '/illuminate/support/HtmlString.php',
380
+ 'Illuminate\\Support\\InteractsWithTime' => $vendorDir . '/illuminate/support/InteractsWithTime.php',
381
+ 'Illuminate\\Support\\LazyCollection' => $vendorDir . '/illuminate/collections/LazyCollection.php',
382
  'Illuminate\\Support\\Manager' => $vendorDir . '/illuminate/support/Manager.php',
383
  'Illuminate\\Support\\MessageBag' => $vendorDir . '/illuminate/support/MessageBag.php',
384
  'Illuminate\\Support\\NamespacedItemResolver' => $vendorDir . '/illuminate/support/NamespacedItemResolver.php',
385
+ 'Illuminate\\Support\\Optional' => $vendorDir . '/illuminate/support/Optional.php',
386
  'Illuminate\\Support\\Pluralizer' => $vendorDir . '/illuminate/support/Pluralizer.php',
387
+ 'Illuminate\\Support\\ProcessUtils' => $vendorDir . '/illuminate/support/ProcessUtils.php',
388
+ 'Illuminate\\Support\\Reflector' => $vendorDir . '/illuminate/support/Reflector.php',
389
  'Illuminate\\Support\\ServiceProvider' => $vendorDir . '/illuminate/support/ServiceProvider.php',
390
  'Illuminate\\Support\\Str' => $vendorDir . '/illuminate/support/Str.php',
391
+ 'Illuminate\\Support\\Stringable' => $vendorDir . '/illuminate/support/Stringable.php',
392
+ 'Illuminate\\Support\\Testing\\Fakes\\BatchRepositoryFake' => $vendorDir . '/illuminate/support/Testing/Fakes/BatchRepositoryFake.php',
393
  'Illuminate\\Support\\Testing\\Fakes\\BusFake' => $vendorDir . '/illuminate/support/Testing/Fakes/BusFake.php',
394
  'Illuminate\\Support\\Testing\\Fakes\\EventFake' => $vendorDir . '/illuminate/support/Testing/Fakes/EventFake.php',
395
  'Illuminate\\Support\\Testing\\Fakes\\MailFake' => $vendorDir . '/illuminate/support/Testing/Fakes/MailFake.php',
396
  'Illuminate\\Support\\Testing\\Fakes\\NotificationFake' => $vendorDir . '/illuminate/support/Testing/Fakes/NotificationFake.php',
397
+ 'Illuminate\\Support\\Testing\\Fakes\\PendingBatchFake' => $vendorDir . '/illuminate/support/Testing/Fakes/PendingBatchFake.php',
398
+ 'Illuminate\\Support\\Testing\\Fakes\\PendingChainFake' => $vendorDir . '/illuminate/support/Testing/Fakes/PendingChainFake.php',
399
  'Illuminate\\Support\\Testing\\Fakes\\PendingMailFake' => $vendorDir . '/illuminate/support/Testing/Fakes/PendingMailFake.php',
400
  'Illuminate\\Support\\Testing\\Fakes\\QueueFake' => $vendorDir . '/illuminate/support/Testing/Fakes/QueueFake.php',
401
  'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => $vendorDir . '/illuminate/support/Traits/CapsuleManagerTrait.php',
402
+ 'Illuminate\\Support\\Traits\\EnumeratesValues' => $vendorDir . '/illuminate/collections/Traits/EnumeratesValues.php',
403
+ 'Illuminate\\Support\\Traits\\ForwardsCalls' => $vendorDir . '/illuminate/support/Traits/ForwardsCalls.php',
404
+ 'Illuminate\\Support\\Traits\\Localizable' => $vendorDir . '/illuminate/support/Traits/Localizable.php',
405
+ 'Illuminate\\Support\\Traits\\Macroable' => $vendorDir . '/illuminate/macroable/Traits/Macroable.php',
406
+ 'Illuminate\\Support\\Traits\\ReflectsClosures' => $vendorDir . '/illuminate/support/Traits/ReflectsClosures.php',
407
+ 'Illuminate\\Support\\Traits\\Tappable' => $vendorDir . '/illuminate/support/Traits/Tappable.php',
408
  'Illuminate\\Support\\ViewErrorBag' => $vendorDir . '/illuminate/support/ViewErrorBag.php',
409
+ 'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
410
+ 'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
411
+ 'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
412
+ 'Psr\\SimpleCache\\CacheException' => $vendorDir . '/psr/simple-cache/src/CacheException.php',
413
+ 'Psr\\SimpleCache\\CacheInterface' => $vendorDir . '/psr/simple-cache/src/CacheInterface.php',
414
+ 'Psr\\SimpleCache\\InvalidArgumentException' => $vendorDir . '/psr/simple-cache/src/InvalidArgumentException.php',
415
  'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
416
  'Symfony\\Component\\Finder\\Comparator\\Comparator' => $vendorDir . '/symfony/finder/Comparator/Comparator.php',
417
  'Symfony\\Component\\Finder\\Comparator\\DateComparator' => $vendorDir . '/symfony/finder/Comparator/DateComparator.php',
418
  'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => $vendorDir . '/symfony/finder/Comparator/NumberComparator.php',
419
  'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => $vendorDir . '/symfony/finder/Exception/AccessDeniedException.php',
420
+ 'Symfony\\Component\\Finder\\Exception\\DirectoryNotFoundException' => $vendorDir . '/symfony/finder/Exception/DirectoryNotFoundException.php',
421
  'Symfony\\Component\\Finder\\Finder' => $vendorDir . '/symfony/finder/Finder.php',
422
+ 'Symfony\\Component\\Finder\\Gitignore' => $vendorDir . '/symfony/finder/Gitignore.php',
423
  'Symfony\\Component\\Finder\\Glob' => $vendorDir . '/symfony/finder/Glob.php',
424
  'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => $vendorDir . '/symfony/finder/Iterator/CustomFilterIterator.php',
425
  'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DateRangeFilterIterator.php',
428
  'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FileTypeFilterIterator.php',
429
  'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilecontentFilterIterator.php',
430
  'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilenameFilterIterator.php',
431
+ 'Symfony\\Component\\Finder\\Iterator\\LazyIterator' => $vendorDir . '/symfony/finder/Iterator/LazyIterator.php',
432
  'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => $vendorDir . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php',
433
  'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => $vendorDir . '/symfony/finder/Iterator/PathFilterIterator.php',
434
  'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => $vendorDir . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php',
512
  'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php',
513
  'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
514
  'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
515
+ 'voku\\helper\\ASCII' => $vendorDir . '/voku/portable-ascii/src/voku/helper/ASCII.php',
516
  );
vendor/composer/autoload_files.php CHANGED
@@ -6,9 +6,9 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
10
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
11
- '72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php',
12
  'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
13
  'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php',
 
14
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
10
+ '60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php',
11
  'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
12
  'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php',
13
+ '72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php',
14
  );
vendor/composer/autoload_psr4.php CHANGED
@@ -6,18 +6,20 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
10
  'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
11
  'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'),
12
  'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
13
  'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
14
- 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/support'),
 
 
15
  'Illuminate\\Filesystem\\' => array($vendorDir . '/illuminate/filesystem'),
16
  'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'),
17
  'Illuminate\\Container\\' => array($vendorDir . '/illuminate/container'),
18
  'Illuminate\\Config\\' => array($vendorDir . '/illuminate/config'),
19
  'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'),
20
- 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'),
21
  'Codelight\\GDPR\\' => array($baseDir . '/src'),
22
  'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
23
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'),
10
  'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
11
  'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
12
  'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'),
13
  'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
14
  'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
15
+ 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
16
+ 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
17
+ 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/support'),
18
  'Illuminate\\Filesystem\\' => array($vendorDir . '/illuminate/filesystem'),
19
  'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'),
20
  'Illuminate\\Container\\' => array($vendorDir . '/illuminate/container'),
21
  'Illuminate\\Config\\' => array($vendorDir . '/illuminate/config'),
22
  'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'),
 
23
  'Codelight\\GDPR\\' => array($baseDir . '/src'),
24
  'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
25
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit60e2ae3689c738e40bd3c5cd32d09b3f
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit60e2ae3689c738e40bd3c5cd32d09b3f
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit60e2ae3689c738e40bd3c5cd32d09b3f', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit60e2ae3689c738e40bd3c5cd32d09b3f', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
@@ -53,19 +53,19 @@ class ComposerAutoloaderInit60e2ae3689c738e40bd3c5cd32d09b3f
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
- $includeFiles = Composer\Autoload\ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
- composerRequire60e2ae3689c738e40bd3c5cd32d09b3f($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
- function composerRequire60e2ae3689c738e40bd3c5cd32d09b3f($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit685660b63662e7b4526beec066cc0ce1
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit685660b63662e7b4526beec066cc0ce1', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit685660b63662e7b4526beec066cc0ce1', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit685660b63662e7b4526beec066cc0ce1::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
+ $includeFiles = Composer\Autoload\ComposerStaticInit685660b63662e7b4526beec066cc0ce1::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequire685660b63662e7b4526beec066cc0ce1($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
+ function composerRequire685660b63662e7b4526beec066cc0ce1($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,17 +4,21 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
8
  {
9
  public static $files = array (
10
- '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
11
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
12
- '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php',
13
  'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
14
  'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php',
 
15
  );
16
 
17
  public static $prefixLengthsPsr4 = array (
 
 
 
 
18
  'S' =>
19
  array (
20
  'Symfony\\Polyfill\\Php80\\' => 23,
@@ -23,6 +27,11 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
23
  'Symfony\\Component\\Translation\\' => 30,
24
  'Symfony\\Component\\Finder\\' => 25,
25
  ),
 
 
 
 
 
26
  'I' =>
27
  array (
28
  'Illuminate\\Support\\' => 19,
@@ -34,7 +43,6 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
34
  'D' =>
35
  array (
36
  'Doctrine\\Inflector\\' => 19,
37
- 'Doctrine\\Common\\Inflector\\' => 26,
38
  ),
39
  'C' =>
40
  array (
@@ -44,6 +52,10 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
44
  );
45
 
46
  public static $prefixDirsPsr4 = array (
 
 
 
 
47
  'Symfony\\Polyfill\\Php80\\' =>
48
  array (
49
  0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
@@ -64,9 +76,19 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
64
  array (
65
  0 => __DIR__ . '/..' . '/symfony/finder',
66
  ),
 
 
 
 
 
 
 
 
67
  'Illuminate\\Support\\' =>
68
  array (
69
- 0 => __DIR__ . '/..' . '/illuminate/support',
 
 
70
  ),
71
  'Illuminate\\Filesystem\\' =>
72
  array (
@@ -88,10 +110,6 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
88
  array (
89
  0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector',
90
  ),
91
- 'Doctrine\\Common\\Inflector\\' =>
92
- array (
93
- 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector',
94
- ),
95
  'Codelight\\GDPR\\' =>
96
  array (
97
  0 => __DIR__ . '/../..' . '/src',
@@ -258,7 +276,6 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
258
  'Codelight\\GDPR\\Updater\\Updater' => __DIR__ . '/../..' . '/src/Updater/Updater.php',
259
  'Codelight\\GDPR\\View' => __DIR__ . '/../..' . '/src/View.php',
260
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
261
- 'Doctrine\\Common\\Inflector\\Inflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php',
262
  'Doctrine\\Inflector\\CachedWordInflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php',
263
  'Doctrine\\Inflector\\GenericLanguageInflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php',
264
  'Doctrine\\Inflector\\Inflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php',
@@ -304,12 +321,17 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
304
  'Illuminate\\Container\\BoundMethod' => __DIR__ . '/..' . '/illuminate/container/BoundMethod.php',
305
  'Illuminate\\Container\\Container' => __DIR__ . '/..' . '/illuminate/container/Container.php',
306
  'Illuminate\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/illuminate/container/ContextualBindingBuilder.php',
 
 
 
307
  'Illuminate\\Contracts\\Auth\\Access\\Authorizable' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Access/Authorizable.php',
308
  'Illuminate\\Contracts\\Auth\\Access\\Gate' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Access/Gate.php',
309
  'Illuminate\\Contracts\\Auth\\Authenticatable' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Authenticatable.php',
310
  'Illuminate\\Contracts\\Auth\\CanResetPassword' => __DIR__ . '/..' . '/illuminate/contracts/Auth/CanResetPassword.php',
311
  'Illuminate\\Contracts\\Auth\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Factory.php',
312
  'Illuminate\\Contracts\\Auth\\Guard' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Guard.php',
 
 
313
  'Illuminate\\Contracts\\Auth\\PasswordBroker' => __DIR__ . '/..' . '/illuminate/contracts/Auth/PasswordBroker.php',
314
  'Illuminate\\Contracts\\Auth\\PasswordBrokerFactory' => __DIR__ . '/..' . '/illuminate/contracts/Auth/PasswordBrokerFactory.php',
315
  'Illuminate\\Contracts\\Auth\\StatefulGuard' => __DIR__ . '/..' . '/illuminate/contracts/Auth/StatefulGuard.php',
@@ -322,30 +344,45 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
322
  'Illuminate\\Contracts\\Bus\\Dispatcher' => __DIR__ . '/..' . '/illuminate/contracts/Bus/Dispatcher.php',
323
  'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => __DIR__ . '/..' . '/illuminate/contracts/Bus/QueueingDispatcher.php',
324
  'Illuminate\\Contracts\\Cache\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Cache/Factory.php',
 
 
 
325
  'Illuminate\\Contracts\\Cache\\Repository' => __DIR__ . '/..' . '/illuminate/contracts/Cache/Repository.php',
326
  'Illuminate\\Contracts\\Cache\\Store' => __DIR__ . '/..' . '/illuminate/contracts/Cache/Store.php',
327
  'Illuminate\\Contracts\\Config\\Repository' => __DIR__ . '/..' . '/illuminate/contracts/Config/Repository.php',
328
  'Illuminate\\Contracts\\Console\\Application' => __DIR__ . '/..' . '/illuminate/contracts/Console/Application.php',
329
  'Illuminate\\Contracts\\Console\\Kernel' => __DIR__ . '/..' . '/illuminate/contracts/Console/Kernel.php',
330
  'Illuminate\\Contracts\\Container\\BindingResolutionException' => __DIR__ . '/..' . '/illuminate/contracts/Container/BindingResolutionException.php',
 
331
  'Illuminate\\Contracts\\Container\\Container' => __DIR__ . '/..' . '/illuminate/contracts/Container/Container.php',
332
  'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/illuminate/contracts/Container/ContextualBindingBuilder.php',
333
  'Illuminate\\Contracts\\Cookie\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Cookie/Factory.php',
334
  'Illuminate\\Contracts\\Cookie\\QueueingFactory' => __DIR__ . '/..' . '/illuminate/contracts/Cookie/QueueingFactory.php',
 
 
 
 
 
 
335
  'Illuminate\\Contracts\\Database\\ModelIdentifier' => __DIR__ . '/..' . '/illuminate/contracts/Database/ModelIdentifier.php',
336
  'Illuminate\\Contracts\\Debug\\ExceptionHandler' => __DIR__ . '/..' . '/illuminate/contracts/Debug/ExceptionHandler.php',
337
  'Illuminate\\Contracts\\Encryption\\DecryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/DecryptException.php',
338
  'Illuminate\\Contracts\\Encryption\\EncryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/EncryptException.php',
339
  'Illuminate\\Contracts\\Encryption\\Encrypter' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/Encrypter.php',
 
340
  'Illuminate\\Contracts\\Events\\Dispatcher' => __DIR__ . '/..' . '/illuminate/contracts/Events/Dispatcher.php',
341
  'Illuminate\\Contracts\\Filesystem\\Cloud' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Cloud.php',
342
  'Illuminate\\Contracts\\Filesystem\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Factory.php',
 
343
  'Illuminate\\Contracts\\Filesystem\\FileNotFoundException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/FileNotFoundException.php',
344
  'Illuminate\\Contracts\\Filesystem\\Filesystem' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Filesystem.php',
 
345
  'Illuminate\\Contracts\\Foundation\\Application' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/Application.php',
 
 
346
  'Illuminate\\Contracts\\Hashing\\Hasher' => __DIR__ . '/..' . '/illuminate/contracts/Hashing/Hasher.php',
347
  'Illuminate\\Contracts\\Http\\Kernel' => __DIR__ . '/..' . '/illuminate/contracts/Http/Kernel.php',
348
- 'Illuminate\\Contracts\\Logging\\Log' => __DIR__ . '/..' . '/illuminate/contracts/Logging/Log.php',
349
  'Illuminate\\Contracts\\Mail\\MailQueue' => __DIR__ . '/..' . '/illuminate/contracts/Mail/MailQueue.php',
350
  'Illuminate\\Contracts\\Mail\\Mailable' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Mailable.php',
351
  'Illuminate\\Contracts\\Mail\\Mailer' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Mailer.php',
@@ -355,6 +392,7 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
355
  'Illuminate\\Contracts\\Pagination\\Paginator' => __DIR__ . '/..' . '/illuminate/contracts/Pagination/Paginator.php',
356
  'Illuminate\\Contracts\\Pipeline\\Hub' => __DIR__ . '/..' . '/illuminate/contracts/Pipeline/Hub.php',
357
  'Illuminate\\Contracts\\Pipeline\\Pipeline' => __DIR__ . '/..' . '/illuminate/contracts/Pipeline/Pipeline.php',
 
358
  'Illuminate\\Contracts\\Queue\\EntityNotFoundException' => __DIR__ . '/..' . '/illuminate/contracts/Queue/EntityNotFoundException.php',
359
  'Illuminate\\Contracts\\Queue\\EntityResolver' => __DIR__ . '/..' . '/illuminate/contracts/Queue/EntityResolver.php',
360
  'Illuminate\\Contracts\\Queue\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Queue/Factory.php',
@@ -363,8 +401,14 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
363
  'Illuminate\\Contracts\\Queue\\Queue' => __DIR__ . '/..' . '/illuminate/contracts/Queue/Queue.php',
364
  'Illuminate\\Contracts\\Queue\\QueueableCollection' => __DIR__ . '/..' . '/illuminate/contracts/Queue/QueueableCollection.php',
365
  'Illuminate\\Contracts\\Queue\\QueueableEntity' => __DIR__ . '/..' . '/illuminate/contracts/Queue/QueueableEntity.php',
 
 
 
366
  'Illuminate\\Contracts\\Queue\\ShouldQueue' => __DIR__ . '/..' . '/illuminate/contracts/Queue/ShouldQueue.php',
 
 
367
  'Illuminate\\Contracts\\Redis\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Redis/Factory.php',
 
368
  'Illuminate\\Contracts\\Routing\\BindingRegistrar' => __DIR__ . '/..' . '/illuminate/contracts/Routing/BindingRegistrar.php',
369
  'Illuminate\\Contracts\\Routing\\Registrar' => __DIR__ . '/..' . '/illuminate/contracts/Routing/Registrar.php',
370
  'Illuminate\\Contracts\\Routing\\ResponseFactory' => __DIR__ . '/..' . '/illuminate/contracts/Routing/ResponseFactory.php',
@@ -372,27 +416,40 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
372
  'Illuminate\\Contracts\\Routing\\UrlRoutable' => __DIR__ . '/..' . '/illuminate/contracts/Routing/UrlRoutable.php',
373
  'Illuminate\\Contracts\\Session\\Session' => __DIR__ . '/..' . '/illuminate/contracts/Session/Session.php',
374
  'Illuminate\\Contracts\\Support\\Arrayable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Arrayable.php',
 
 
375
  'Illuminate\\Contracts\\Support\\Htmlable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Htmlable.php',
376
  'Illuminate\\Contracts\\Support\\Jsonable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Jsonable.php',
377
  'Illuminate\\Contracts\\Support\\MessageBag' => __DIR__ . '/..' . '/illuminate/contracts/Support/MessageBag.php',
378
  'Illuminate\\Contracts\\Support\\MessageProvider' => __DIR__ . '/..' . '/illuminate/contracts/Support/MessageProvider.php',
379
  'Illuminate\\Contracts\\Support\\Renderable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Renderable.php',
 
 
 
380
  'Illuminate\\Contracts\\Translation\\Translator' => __DIR__ . '/..' . '/illuminate/contracts/Translation/Translator.php',
381
  'Illuminate\\Contracts\\Validation\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Validation/Factory.php',
 
 
382
  'Illuminate\\Contracts\\Validation\\ValidatesWhenResolved' => __DIR__ . '/..' . '/illuminate/contracts/Validation/ValidatesWhenResolved.php',
383
  'Illuminate\\Contracts\\Validation\\Validator' => __DIR__ . '/..' . '/illuminate/contracts/Validation/Validator.php',
 
384
  'Illuminate\\Contracts\\View\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/View/Factory.php',
385
  'Illuminate\\Contracts\\View\\View' => __DIR__ . '/..' . '/illuminate/contracts/View/View.php',
 
386
  'Illuminate\\Filesystem\\Filesystem' => __DIR__ . '/..' . '/illuminate/filesystem/Filesystem.php',
387
  'Illuminate\\Filesystem\\FilesystemAdapter' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemAdapter.php',
388
  'Illuminate\\Filesystem\\FilesystemManager' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemManager.php',
389
  'Illuminate\\Filesystem\\FilesystemServiceProvider' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemServiceProvider.php',
 
390
  'Illuminate\\Support\\AggregateServiceProvider' => __DIR__ . '/..' . '/illuminate/support/AggregateServiceProvider.php',
391
- 'Illuminate\\Support\\Arr' => __DIR__ . '/..' . '/illuminate/support/Arr.php',
392
- 'Illuminate\\Support\\Collection' => __DIR__ . '/..' . '/illuminate/support/Collection.php',
 
393
  'Illuminate\\Support\\Composer' => __DIR__ . '/..' . '/illuminate/support/Composer.php',
394
- 'Illuminate\\Support\\Debug\\Dumper' => __DIR__ . '/..' . '/illuminate/support/Debug/Dumper.php',
395
- 'Illuminate\\Support\\Debug\\HtmlDumper' => __DIR__ . '/..' . '/illuminate/support/Debug/HtmlDumper.php',
 
 
396
  'Illuminate\\Support\\Facades\\App' => __DIR__ . '/..' . '/illuminate/support/Facades/App.php',
397
  'Illuminate\\Support\\Facades\\Artisan' => __DIR__ . '/..' . '/illuminate/support/Facades/Artisan.php',
398
  'Illuminate\\Support\\Facades\\Auth' => __DIR__ . '/..' . '/illuminate/support/Facades/Auth.php',
@@ -404,18 +461,21 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
404
  'Illuminate\\Support\\Facades\\Cookie' => __DIR__ . '/..' . '/illuminate/support/Facades/Cookie.php',
405
  'Illuminate\\Support\\Facades\\Crypt' => __DIR__ . '/..' . '/illuminate/support/Facades/Crypt.php',
406
  'Illuminate\\Support\\Facades\\DB' => __DIR__ . '/..' . '/illuminate/support/Facades/DB.php',
 
407
  'Illuminate\\Support\\Facades\\Event' => __DIR__ . '/..' . '/illuminate/support/Facades/Event.php',
408
  'Illuminate\\Support\\Facades\\Facade' => __DIR__ . '/..' . '/illuminate/support/Facades/Facade.php',
409
  'Illuminate\\Support\\Facades\\File' => __DIR__ . '/..' . '/illuminate/support/Facades/File.php',
410
  'Illuminate\\Support\\Facades\\Gate' => __DIR__ . '/..' . '/illuminate/support/Facades/Gate.php',
411
  'Illuminate\\Support\\Facades\\Hash' => __DIR__ . '/..' . '/illuminate/support/Facades/Hash.php',
412
- 'Illuminate\\Support\\Facades\\Input' => __DIR__ . '/..' . '/illuminate/support/Facades/Input.php',
413
  'Illuminate\\Support\\Facades\\Lang' => __DIR__ . '/..' . '/illuminate/support/Facades/Lang.php',
414
  'Illuminate\\Support\\Facades\\Log' => __DIR__ . '/..' . '/illuminate/support/Facades/Log.php',
415
  'Illuminate\\Support\\Facades\\Mail' => __DIR__ . '/..' . '/illuminate/support/Facades/Mail.php',
416
  'Illuminate\\Support\\Facades\\Notification' => __DIR__ . '/..' . '/illuminate/support/Facades/Notification.php',
 
417
  'Illuminate\\Support\\Facades\\Password' => __DIR__ . '/..' . '/illuminate/support/Facades/Password.php',
418
  'Illuminate\\Support\\Facades\\Queue' => __DIR__ . '/..' . '/illuminate/support/Facades/Queue.php',
 
419
  'Illuminate\\Support\\Facades\\Redirect' => __DIR__ . '/..' . '/illuminate/support/Facades/Redirect.php',
420
  'Illuminate\\Support\\Facades\\Redis' => __DIR__ . '/..' . '/illuminate/support/Facades/Redis.php',
421
  'Illuminate\\Support\\Facades\\Request' => __DIR__ . '/..' . '/illuminate/support/Facades/Request.php',
@@ -428,31 +488,53 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
428
  'Illuminate\\Support\\Facades\\Validator' => __DIR__ . '/..' . '/illuminate/support/Facades/Validator.php',
429
  'Illuminate\\Support\\Facades\\View' => __DIR__ . '/..' . '/illuminate/support/Facades/View.php',
430
  'Illuminate\\Support\\Fluent' => __DIR__ . '/..' . '/illuminate/support/Fluent.php',
431
- 'Illuminate\\Support\\HigherOrderCollectionProxy' => __DIR__ . '/..' . '/illuminate/support/HigherOrderCollectionProxy.php',
432
  'Illuminate\\Support\\HigherOrderTapProxy' => __DIR__ . '/..' . '/illuminate/support/HigherOrderTapProxy.php',
 
433
  'Illuminate\\Support\\HtmlString' => __DIR__ . '/..' . '/illuminate/support/HtmlString.php',
 
 
434
  'Illuminate\\Support\\Manager' => __DIR__ . '/..' . '/illuminate/support/Manager.php',
435
  'Illuminate\\Support\\MessageBag' => __DIR__ . '/..' . '/illuminate/support/MessageBag.php',
436
  'Illuminate\\Support\\NamespacedItemResolver' => __DIR__ . '/..' . '/illuminate/support/NamespacedItemResolver.php',
 
437
  'Illuminate\\Support\\Pluralizer' => __DIR__ . '/..' . '/illuminate/support/Pluralizer.php',
 
 
438
  'Illuminate\\Support\\ServiceProvider' => __DIR__ . '/..' . '/illuminate/support/ServiceProvider.php',
439
  'Illuminate\\Support\\Str' => __DIR__ . '/..' . '/illuminate/support/Str.php',
 
 
440
  'Illuminate\\Support\\Testing\\Fakes\\BusFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/BusFake.php',
441
  'Illuminate\\Support\\Testing\\Fakes\\EventFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/EventFake.php',
442
  'Illuminate\\Support\\Testing\\Fakes\\MailFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/MailFake.php',
443
  'Illuminate\\Support\\Testing\\Fakes\\NotificationFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/NotificationFake.php',
 
 
444
  'Illuminate\\Support\\Testing\\Fakes\\PendingMailFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/PendingMailFake.php',
445
  'Illuminate\\Support\\Testing\\Fakes\\QueueFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/QueueFake.php',
446
  'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => __DIR__ . '/..' . '/illuminate/support/Traits/CapsuleManagerTrait.php',
447
- 'Illuminate\\Support\\Traits\\Macroable' => __DIR__ . '/..' . '/illuminate/support/Traits/Macroable.php',
 
 
 
 
 
448
  'Illuminate\\Support\\ViewErrorBag' => __DIR__ . '/..' . '/illuminate/support/ViewErrorBag.php',
 
 
 
 
 
 
449
  'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
450
  'Symfony\\Component\\Finder\\Comparator\\Comparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/Comparator.php',
451
  'Symfony\\Component\\Finder\\Comparator\\DateComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/DateComparator.php',
452
  'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/NumberComparator.php',
453
  'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => __DIR__ . '/..' . '/symfony/finder/Exception/AccessDeniedException.php',
454
- 'Symfony\\Component\\Finder\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/finder/Exception/ExceptionInterface.php',
455
  'Symfony\\Component\\Finder\\Finder' => __DIR__ . '/..' . '/symfony/finder/Finder.php',
 
456
  'Symfony\\Component\\Finder\\Glob' => __DIR__ . '/..' . '/symfony/finder/Glob.php',
457
  'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/CustomFilterIterator.php',
458
  'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/DateRangeFilterIterator.php',
@@ -461,7 +543,7 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
461
  'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FileTypeFilterIterator.php',
462
  'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilecontentFilterIterator.php',
463
  'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilenameFilterIterator.php',
464
- 'Symfony\\Component\\Finder\\Iterator\\FilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilterIterator.php',
465
  'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php',
466
  'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/PathFilterIterator.php',
467
  'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php',
@@ -545,14 +627,15 @@ class ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f
545
  'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php',
546
  'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
547
  'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
 
548
  );
549
 
550
  public static function getInitializer(ClassLoader $loader)
551
  {
552
  return \Closure::bind(function () use ($loader) {
553
- $loader->prefixLengthsPsr4 = ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f::$prefixLengthsPsr4;
554
- $loader->prefixDirsPsr4 = ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f::$prefixDirsPsr4;
555
- $loader->classMap = ComposerStaticInit60e2ae3689c738e40bd3c5cd32d09b3f::$classMap;
556
 
557
  }, null, ClassLoader::class);
558
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit685660b63662e7b4526beec066cc0ce1
8
  {
9
  public static $files = array (
 
10
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
11
+ '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php',
12
  'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
13
  'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php',
14
+ '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php',
15
  );
16
 
17
  public static $prefixLengthsPsr4 = array (
18
+ 'v' =>
19
+ array (
20
+ 'voku\\' => 5,
21
+ ),
22
  'S' =>
23
  array (
24
  'Symfony\\Polyfill\\Php80\\' => 23,
27
  'Symfony\\Component\\Translation\\' => 30,
28
  'Symfony\\Component\\Finder\\' => 25,
29
  ),
30
+ 'P' =>
31
+ array (
32
+ 'Psr\\SimpleCache\\' => 16,
33
+ 'Psr\\Container\\' => 14,
34
+ ),
35
  'I' =>
36
  array (
37
  'Illuminate\\Support\\' => 19,
43
  'D' =>
44
  array (
45
  'Doctrine\\Inflector\\' => 19,
 
46
  ),
47
  'C' =>
48
  array (
52
  );
53
 
54
  public static $prefixDirsPsr4 = array (
55
+ 'voku\\' =>
56
+ array (
57
+ 0 => __DIR__ . '/..' . '/voku/portable-ascii/src/voku',
58
+ ),
59
  'Symfony\\Polyfill\\Php80\\' =>
60
  array (
61
  0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
76
  array (
77
  0 => __DIR__ . '/..' . '/symfony/finder',
78
  ),
79
+ 'Psr\\SimpleCache\\' =>
80
+ array (
81
+ 0 => __DIR__ . '/..' . '/psr/simple-cache/src',
82
+ ),
83
+ 'Psr\\Container\\' =>
84
+ array (
85
+ 0 => __DIR__ . '/..' . '/psr/container/src',
86
+ ),
87
  'Illuminate\\Support\\' =>
88
  array (
89
+ 0 => __DIR__ . '/..' . '/illuminate/macroable',
90
+ 1 => __DIR__ . '/..' . '/illuminate/collections',
91
+ 2 => __DIR__ . '/..' . '/illuminate/support',
92
  ),
93
  'Illuminate\\Filesystem\\' =>
94
  array (
110
  array (
111
  0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector',
112
  ),
 
 
 
 
113
  'Codelight\\GDPR\\' =>
114
  array (
115
  0 => __DIR__ . '/../..' . '/src',
276
  'Codelight\\GDPR\\Updater\\Updater' => __DIR__ . '/../..' . '/src/Updater/Updater.php',
277
  'Codelight\\GDPR\\View' => __DIR__ . '/../..' . '/src/View.php',
278
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
 
279
  'Doctrine\\Inflector\\CachedWordInflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php',
280
  'Doctrine\\Inflector\\GenericLanguageInflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php',
281
  'Doctrine\\Inflector\\Inflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php',
321
  'Illuminate\\Container\\BoundMethod' => __DIR__ . '/..' . '/illuminate/container/BoundMethod.php',
322
  'Illuminate\\Container\\Container' => __DIR__ . '/..' . '/illuminate/container/Container.php',
323
  'Illuminate\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/illuminate/container/ContextualBindingBuilder.php',
324
+ 'Illuminate\\Container\\EntryNotFoundException' => __DIR__ . '/..' . '/illuminate/container/EntryNotFoundException.php',
325
+ 'Illuminate\\Container\\RewindableGenerator' => __DIR__ . '/..' . '/illuminate/container/RewindableGenerator.php',
326
+ 'Illuminate\\Container\\Util' => __DIR__ . '/..' . '/illuminate/container/Util.php',
327
  'Illuminate\\Contracts\\Auth\\Access\\Authorizable' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Access/Authorizable.php',
328
  'Illuminate\\Contracts\\Auth\\Access\\Gate' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Access/Gate.php',
329
  'Illuminate\\Contracts\\Auth\\Authenticatable' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Authenticatable.php',
330
  'Illuminate\\Contracts\\Auth\\CanResetPassword' => __DIR__ . '/..' . '/illuminate/contracts/Auth/CanResetPassword.php',
331
  'Illuminate\\Contracts\\Auth\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Factory.php',
332
  'Illuminate\\Contracts\\Auth\\Guard' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Guard.php',
333
+ 'Illuminate\\Contracts\\Auth\\Middleware\\AuthenticatesRequests' => __DIR__ . '/..' . '/illuminate/contracts/Auth/Middleware/AuthenticatesRequests.php',
334
+ 'Illuminate\\Contracts\\Auth\\MustVerifyEmail' => __DIR__ . '/..' . '/illuminate/contracts/Auth/MustVerifyEmail.php',
335
  'Illuminate\\Contracts\\Auth\\PasswordBroker' => __DIR__ . '/..' . '/illuminate/contracts/Auth/PasswordBroker.php',
336
  'Illuminate\\Contracts\\Auth\\PasswordBrokerFactory' => __DIR__ . '/..' . '/illuminate/contracts/Auth/PasswordBrokerFactory.php',
337
  'Illuminate\\Contracts\\Auth\\StatefulGuard' => __DIR__ . '/..' . '/illuminate/contracts/Auth/StatefulGuard.php',
344
  'Illuminate\\Contracts\\Bus\\Dispatcher' => __DIR__ . '/..' . '/illuminate/contracts/Bus/Dispatcher.php',
345
  'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => __DIR__ . '/..' . '/illuminate/contracts/Bus/QueueingDispatcher.php',
346
  'Illuminate\\Contracts\\Cache\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Cache/Factory.php',
347
+ 'Illuminate\\Contracts\\Cache\\Lock' => __DIR__ . '/..' . '/illuminate/contracts/Cache/Lock.php',
348
+ 'Illuminate\\Contracts\\Cache\\LockProvider' => __DIR__ . '/..' . '/illuminate/contracts/Cache/LockProvider.php',
349
+ 'Illuminate\\Contracts\\Cache\\LockTimeoutException' => __DIR__ . '/..' . '/illuminate/contracts/Cache/LockTimeoutException.php',
350
  'Illuminate\\Contracts\\Cache\\Repository' => __DIR__ . '/..' . '/illuminate/contracts/Cache/Repository.php',
351
  'Illuminate\\Contracts\\Cache\\Store' => __DIR__ . '/..' . '/illuminate/contracts/Cache/Store.php',
352
  'Illuminate\\Contracts\\Config\\Repository' => __DIR__ . '/..' . '/illuminate/contracts/Config/Repository.php',
353
  'Illuminate\\Contracts\\Console\\Application' => __DIR__ . '/..' . '/illuminate/contracts/Console/Application.php',
354
  'Illuminate\\Contracts\\Console\\Kernel' => __DIR__ . '/..' . '/illuminate/contracts/Console/Kernel.php',
355
  'Illuminate\\Contracts\\Container\\BindingResolutionException' => __DIR__ . '/..' . '/illuminate/contracts/Container/BindingResolutionException.php',
356
+ 'Illuminate\\Contracts\\Container\\CircularDependencyException' => __DIR__ . '/..' . '/illuminate/contracts/Container/CircularDependencyException.php',
357
  'Illuminate\\Contracts\\Container\\Container' => __DIR__ . '/..' . '/illuminate/contracts/Container/Container.php',
358
  'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/illuminate/contracts/Container/ContextualBindingBuilder.php',
359
  'Illuminate\\Contracts\\Cookie\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Cookie/Factory.php',
360
  'Illuminate\\Contracts\\Cookie\\QueueingFactory' => __DIR__ . '/..' . '/illuminate/contracts/Cookie/QueueingFactory.php',
361
+ 'Illuminate\\Contracts\\Database\\Eloquent\\Castable' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/Castable.php',
362
+ 'Illuminate\\Contracts\\Database\\Eloquent\\CastsAttributes' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/CastsAttributes.php',
363
+ 'Illuminate\\Contracts\\Database\\Eloquent\\CastsInboundAttributes' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php',
364
+ 'Illuminate\\Contracts\\Database\\Eloquent\\DeviatesCastableAttributes' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/DeviatesCastableAttributes.php',
365
+ 'Illuminate\\Contracts\\Database\\Eloquent\\SerializesCastableAttributes' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/SerializesCastableAttributes.php',
366
+ 'Illuminate\\Contracts\\Database\\Events\\MigrationEvent' => __DIR__ . '/..' . '/illuminate/contracts/Database/Events/MigrationEvent.php',
367
  'Illuminate\\Contracts\\Database\\ModelIdentifier' => __DIR__ . '/..' . '/illuminate/contracts/Database/ModelIdentifier.php',
368
  'Illuminate\\Contracts\\Debug\\ExceptionHandler' => __DIR__ . '/..' . '/illuminate/contracts/Debug/ExceptionHandler.php',
369
  'Illuminate\\Contracts\\Encryption\\DecryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/DecryptException.php',
370
  'Illuminate\\Contracts\\Encryption\\EncryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/EncryptException.php',
371
  'Illuminate\\Contracts\\Encryption\\Encrypter' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/Encrypter.php',
372
+ 'Illuminate\\Contracts\\Encryption\\StringEncrypter' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/StringEncrypter.php',
373
  'Illuminate\\Contracts\\Events\\Dispatcher' => __DIR__ . '/..' . '/illuminate/contracts/Events/Dispatcher.php',
374
  'Illuminate\\Contracts\\Filesystem\\Cloud' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Cloud.php',
375
  'Illuminate\\Contracts\\Filesystem\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Factory.php',
376
+ 'Illuminate\\Contracts\\Filesystem\\FileExistsException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/FileExistsException.php',
377
  'Illuminate\\Contracts\\Filesystem\\FileNotFoundException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/FileNotFoundException.php',
378
  'Illuminate\\Contracts\\Filesystem\\Filesystem' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Filesystem.php',
379
+ 'Illuminate\\Contracts\\Filesystem\\LockTimeoutException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/LockTimeoutException.php',
380
  'Illuminate\\Contracts\\Foundation\\Application' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/Application.php',
381
+ 'Illuminate\\Contracts\\Foundation\\CachesConfiguration' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/CachesConfiguration.php',
382
+ 'Illuminate\\Contracts\\Foundation\\CachesRoutes' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/CachesRoutes.php',
383
  'Illuminate\\Contracts\\Hashing\\Hasher' => __DIR__ . '/..' . '/illuminate/contracts/Hashing/Hasher.php',
384
  'Illuminate\\Contracts\\Http\\Kernel' => __DIR__ . '/..' . '/illuminate/contracts/Http/Kernel.php',
385
+ 'Illuminate\\Contracts\\Mail\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Factory.php',
386
  'Illuminate\\Contracts\\Mail\\MailQueue' => __DIR__ . '/..' . '/illuminate/contracts/Mail/MailQueue.php',
387
  'Illuminate\\Contracts\\Mail\\Mailable' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Mailable.php',
388
  'Illuminate\\Contracts\\Mail\\Mailer' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Mailer.php',
392
  'Illuminate\\Contracts\\Pagination\\Paginator' => __DIR__ . '/..' . '/illuminate/contracts/Pagination/Paginator.php',
393
  'Illuminate\\Contracts\\Pipeline\\Hub' => __DIR__ . '/..' . '/illuminate/contracts/Pipeline/Hub.php',
394
  'Illuminate\\Contracts\\Pipeline\\Pipeline' => __DIR__ . '/..' . '/illuminate/contracts/Pipeline/Pipeline.php',
395
+ 'Illuminate\\Contracts\\Queue\\ClearableQueue' => __DIR__ . '/..' . '/illuminate/contracts/Queue/ClearableQueue.php',
396
  'Illuminate\\Contracts\\Queue\\EntityNotFoundException' => __DIR__ . '/..' . '/illuminate/contracts/Queue/EntityNotFoundException.php',
397
  'Illuminate\\Contracts\\Queue\\EntityResolver' => __DIR__ . '/..' . '/illuminate/contracts/Queue/EntityResolver.php',
398
  'Illuminate\\Contracts\\Queue\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Queue/Factory.php',
401
  'Illuminate\\Contracts\\Queue\\Queue' => __DIR__ . '/..' . '/illuminate/contracts/Queue/Queue.php',
402
  'Illuminate\\Contracts\\Queue\\QueueableCollection' => __DIR__ . '/..' . '/illuminate/contracts/Queue/QueueableCollection.php',
403
  'Illuminate\\Contracts\\Queue\\QueueableEntity' => __DIR__ . '/..' . '/illuminate/contracts/Queue/QueueableEntity.php',
404
+ 'Illuminate\\Contracts\\Queue\\ShouldBeEncrypted' => __DIR__ . '/..' . '/illuminate/contracts/Queue/ShouldBeEncrypted.php',
405
+ 'Illuminate\\Contracts\\Queue\\ShouldBeUnique' => __DIR__ . '/..' . '/illuminate/contracts/Queue/ShouldBeUnique.php',
406
+ 'Illuminate\\Contracts\\Queue\\ShouldBeUniqueUntilProcessing' => __DIR__ . '/..' . '/illuminate/contracts/Queue/ShouldBeUniqueUntilProcessing.php',
407
  'Illuminate\\Contracts\\Queue\\ShouldQueue' => __DIR__ . '/..' . '/illuminate/contracts/Queue/ShouldQueue.php',
408
+ 'Illuminate\\Contracts\\Redis\\Connection' => __DIR__ . '/..' . '/illuminate/contracts/Redis/Connection.php',
409
+ 'Illuminate\\Contracts\\Redis\\Connector' => __DIR__ . '/..' . '/illuminate/contracts/Redis/Connector.php',
410
  'Illuminate\\Contracts\\Redis\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Redis/Factory.php',
411
+ 'Illuminate\\Contracts\\Redis\\LimiterTimeoutException' => __DIR__ . '/..' . '/illuminate/contracts/Redis/LimiterTimeoutException.php',
412
  'Illuminate\\Contracts\\Routing\\BindingRegistrar' => __DIR__ . '/..' . '/illuminate/contracts/Routing/BindingRegistrar.php',
413
  'Illuminate\\Contracts\\Routing\\Registrar' => __DIR__ . '/..' . '/illuminate/contracts/Routing/Registrar.php',
414
  'Illuminate\\Contracts\\Routing\\ResponseFactory' => __DIR__ . '/..' . '/illuminate/contracts/Routing/ResponseFactory.php',
416
  'Illuminate\\Contracts\\Routing\\UrlRoutable' => __DIR__ . '/..' . '/illuminate/contracts/Routing/UrlRoutable.php',
417
  'Illuminate\\Contracts\\Session\\Session' => __DIR__ . '/..' . '/illuminate/contracts/Session/Session.php',
418
  'Illuminate\\Contracts\\Support\\Arrayable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Arrayable.php',
419
+ 'Illuminate\\Contracts\\Support\\DeferrableProvider' => __DIR__ . '/..' . '/illuminate/contracts/Support/DeferrableProvider.php',
420
+ 'Illuminate\\Contracts\\Support\\DeferringDisplayableValue' => __DIR__ . '/..' . '/illuminate/contracts/Support/DeferringDisplayableValue.php',
421
  'Illuminate\\Contracts\\Support\\Htmlable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Htmlable.php',
422
  'Illuminate\\Contracts\\Support\\Jsonable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Jsonable.php',
423
  'Illuminate\\Contracts\\Support\\MessageBag' => __DIR__ . '/..' . '/illuminate/contracts/Support/MessageBag.php',
424
  'Illuminate\\Contracts\\Support\\MessageProvider' => __DIR__ . '/..' . '/illuminate/contracts/Support/MessageProvider.php',
425
  'Illuminate\\Contracts\\Support\\Renderable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Renderable.php',
426
+ 'Illuminate\\Contracts\\Support\\Responsable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Responsable.php',
427
+ 'Illuminate\\Contracts\\Translation\\HasLocalePreference' => __DIR__ . '/..' . '/illuminate/contracts/Translation/HasLocalePreference.php',
428
+ 'Illuminate\\Contracts\\Translation\\Loader' => __DIR__ . '/..' . '/illuminate/contracts/Translation/Loader.php',
429
  'Illuminate\\Contracts\\Translation\\Translator' => __DIR__ . '/..' . '/illuminate/contracts/Translation/Translator.php',
430
  'Illuminate\\Contracts\\Validation\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Validation/Factory.php',
431
+ 'Illuminate\\Contracts\\Validation\\ImplicitRule' => __DIR__ . '/..' . '/illuminate/contracts/Validation/ImplicitRule.php',
432
+ 'Illuminate\\Contracts\\Validation\\Rule' => __DIR__ . '/..' . '/illuminate/contracts/Validation/Rule.php',
433
  'Illuminate\\Contracts\\Validation\\ValidatesWhenResolved' => __DIR__ . '/..' . '/illuminate/contracts/Validation/ValidatesWhenResolved.php',
434
  'Illuminate\\Contracts\\Validation\\Validator' => __DIR__ . '/..' . '/illuminate/contracts/Validation/Validator.php',
435
+ 'Illuminate\\Contracts\\View\\Engine' => __DIR__ . '/..' . '/illuminate/contracts/View/Engine.php',
436
  'Illuminate\\Contracts\\View\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/View/Factory.php',
437
  'Illuminate\\Contracts\\View\\View' => __DIR__ . '/..' . '/illuminate/contracts/View/View.php',
438
+ 'Illuminate\\Filesystem\\Cache' => __DIR__ . '/..' . '/illuminate/filesystem/Cache.php',
439
  'Illuminate\\Filesystem\\Filesystem' => __DIR__ . '/..' . '/illuminate/filesystem/Filesystem.php',
440
  'Illuminate\\Filesystem\\FilesystemAdapter' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemAdapter.php',
441
  'Illuminate\\Filesystem\\FilesystemManager' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemManager.php',
442
  'Illuminate\\Filesystem\\FilesystemServiceProvider' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemServiceProvider.php',
443
+ 'Illuminate\\Filesystem\\LockableFile' => __DIR__ . '/..' . '/illuminate/filesystem/LockableFile.php',
444
  'Illuminate\\Support\\AggregateServiceProvider' => __DIR__ . '/..' . '/illuminate/support/AggregateServiceProvider.php',
445
+ 'Illuminate\\Support\\Arr' => __DIR__ . '/..' . '/illuminate/collections/Arr.php',
446
+ 'Illuminate\\Support\\Carbon' => __DIR__ . '/..' . '/illuminate/support/Carbon.php',
447
+ 'Illuminate\\Support\\Collection' => __DIR__ . '/..' . '/illuminate/collections/Collection.php',
448
  'Illuminate\\Support\\Composer' => __DIR__ . '/..' . '/illuminate/support/Composer.php',
449
+ 'Illuminate\\Support\\ConfigurationUrlParser' => __DIR__ . '/..' . '/illuminate/support/ConfigurationUrlParser.php',
450
+ 'Illuminate\\Support\\DateFactory' => __DIR__ . '/..' . '/illuminate/support/DateFactory.php',
451
+ 'Illuminate\\Support\\Enumerable' => __DIR__ . '/..' . '/illuminate/collections/Enumerable.php',
452
+ 'Illuminate\\Support\\Env' => __DIR__ . '/..' . '/illuminate/support/Env.php',
453
  'Illuminate\\Support\\Facades\\App' => __DIR__ . '/..' . '/illuminate/support/Facades/App.php',
454
  'Illuminate\\Support\\Facades\\Artisan' => __DIR__ . '/..' . '/illuminate/support/Facades/Artisan.php',
455
  'Illuminate\\Support\\Facades\\Auth' => __DIR__ . '/..' . '/illuminate/support/Facades/Auth.php',
461
  'Illuminate\\Support\\Facades\\Cookie' => __DIR__ . '/..' . '/illuminate/support/Facades/Cookie.php',
462
  'Illuminate\\Support\\Facades\\Crypt' => __DIR__ . '/..' . '/illuminate/support/Facades/Crypt.php',
463
  'Illuminate\\Support\\Facades\\DB' => __DIR__ . '/..' . '/illuminate/support/Facades/DB.php',
464
+ 'Illuminate\\Support\\Facades\\Date' => __DIR__ . '/..' . '/illuminate/support/Facades/Date.php',
465
  'Illuminate\\Support\\Facades\\Event' => __DIR__ . '/..' . '/illuminate/support/Facades/Event.php',
466
  'Illuminate\\Support\\Facades\\Facade' => __DIR__ . '/..' . '/illuminate/support/Facades/Facade.php',
467
  'Illuminate\\Support\\Facades\\File' => __DIR__ . '/..' . '/illuminate/support/Facades/File.php',
468
  'Illuminate\\Support\\Facades\\Gate' => __DIR__ . '/..' . '/illuminate/support/Facades/Gate.php',
469
  'Illuminate\\Support\\Facades\\Hash' => __DIR__ . '/..' . '/illuminate/support/Facades/Hash.php',
470
+ 'Illuminate\\Support\\Facades\\Http' => __DIR__ . '/..' . '/illuminate/support/Facades/Http.php',
471
  'Illuminate\\Support\\Facades\\Lang' => __DIR__ . '/..' . '/illuminate/support/Facades/Lang.php',
472
  'Illuminate\\Support\\Facades\\Log' => __DIR__ . '/..' . '/illuminate/support/Facades/Log.php',
473
  'Illuminate\\Support\\Facades\\Mail' => __DIR__ . '/..' . '/illuminate/support/Facades/Mail.php',
474
  'Illuminate\\Support\\Facades\\Notification' => __DIR__ . '/..' . '/illuminate/support/Facades/Notification.php',
475
+ 'Illuminate\\Support\\Facades\\ParallelTesting' => __DIR__ . '/..' . '/illuminate/support/Facades/ParallelTesting.php',
476
  'Illuminate\\Support\\Facades\\Password' => __DIR__ . '/..' . '/illuminate/support/Facades/Password.php',
477
  'Illuminate\\Support\\Facades\\Queue' => __DIR__ . '/..' . '/illuminate/support/Facades/Queue.php',
478
+ 'Illuminate\\Support\\Facades\\RateLimiter' => __DIR__ . '/..' . '/illuminate/support/Facades/RateLimiter.php',
479
  'Illuminate\\Support\\Facades\\Redirect' => __DIR__ . '/..' . '/illuminate/support/Facades/Redirect.php',
480
  'Illuminate\\Support\\Facades\\Redis' => __DIR__ . '/..' . '/illuminate/support/Facades/Redis.php',
481
  'Illuminate\\Support\\Facades\\Request' => __DIR__ . '/..' . '/illuminate/support/Facades/Request.php',
488
  'Illuminate\\Support\\Facades\\Validator' => __DIR__ . '/..' . '/illuminate/support/Facades/Validator.php',
489
  'Illuminate\\Support\\Facades\\View' => __DIR__ . '/..' . '/illuminate/support/Facades/View.php',
490
  'Illuminate\\Support\\Fluent' => __DIR__ . '/..' . '/illuminate/support/Fluent.php',
491
+ 'Illuminate\\Support\\HigherOrderCollectionProxy' => __DIR__ . '/..' . '/illuminate/collections/HigherOrderCollectionProxy.php',
492
  'Illuminate\\Support\\HigherOrderTapProxy' => __DIR__ . '/..' . '/illuminate/support/HigherOrderTapProxy.php',
493
+ 'Illuminate\\Support\\HigherOrderWhenProxy' => __DIR__ . '/..' . '/illuminate/collections/HigherOrderWhenProxy.php',
494
  'Illuminate\\Support\\HtmlString' => __DIR__ . '/..' . '/illuminate/support/HtmlString.php',
495
+ 'Illuminate\\Support\\InteractsWithTime' => __DIR__ . '/..' . '/illuminate/support/InteractsWithTime.php',
496
+ 'Illuminate\\Support\\LazyCollection' => __DIR__ . '/..' . '/illuminate/collections/LazyCollection.php',
497
  'Illuminate\\Support\\Manager' => __DIR__ . '/..' . '/illuminate/support/Manager.php',
498
  'Illuminate\\Support\\MessageBag' => __DIR__ . '/..' . '/illuminate/support/MessageBag.php',
499
  'Illuminate\\Support\\NamespacedItemResolver' => __DIR__ . '/..' . '/illuminate/support/NamespacedItemResolver.php',
500
+ 'Illuminate\\Support\\Optional' => __DIR__ . '/..' . '/illuminate/support/Optional.php',
501
  'Illuminate\\Support\\Pluralizer' => __DIR__ . '/..' . '/illuminate/support/Pluralizer.php',
502
+ 'Illuminate\\Support\\ProcessUtils' => __DIR__ . '/..' . '/illuminate/support/ProcessUtils.php',
503
+ 'Illuminate\\Support\\Reflector' => __DIR__ . '/..' . '/illuminate/support/Reflector.php',
504
  'Illuminate\\Support\\ServiceProvider' => __DIR__ . '/..' . '/illuminate/support/ServiceProvider.php',
505
  'Illuminate\\Support\\Str' => __DIR__ . '/..' . '/illuminate/support/Str.php',
506
+ 'Illuminate\\Support\\Stringable' => __DIR__ . '/..' . '/illuminate/support/Stringable.php',
507
+ 'Illuminate\\Support\\Testing\\Fakes\\BatchRepositoryFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/BatchRepositoryFake.php',
508
  'Illuminate\\Support\\Testing\\Fakes\\BusFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/BusFake.php',
509
  'Illuminate\\Support\\Testing\\Fakes\\EventFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/EventFake.php',
510
  'Illuminate\\Support\\Testing\\Fakes\\MailFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/MailFake.php',
511
  'Illuminate\\Support\\Testing\\Fakes\\NotificationFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/NotificationFake.php',
512
+ 'Illuminate\\Support\\Testing\\Fakes\\PendingBatchFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/PendingBatchFake.php',
513
+ 'Illuminate\\Support\\Testing\\Fakes\\PendingChainFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/PendingChainFake.php',
514
  'Illuminate\\Support\\Testing\\Fakes\\PendingMailFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/PendingMailFake.php',
515
  'Illuminate\\Support\\Testing\\Fakes\\QueueFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/QueueFake.php',
516
  'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => __DIR__ . '/..' . '/illuminate/support/Traits/CapsuleManagerTrait.php',
517
+ 'Illuminate\\Support\\Traits\\EnumeratesValues' => __DIR__ . '/..' . '/illuminate/collections/Traits/EnumeratesValues.php',
518
+ 'Illuminate\\Support\\Traits\\ForwardsCalls' => __DIR__ . '/..' . '/illuminate/support/Traits/ForwardsCalls.php',
519
+ 'Illuminate\\Support\\Traits\\Localizable' => __DIR__ . '/..' . '/illuminate/support/Traits/Localizable.php',
520
+ 'Illuminate\\Support\\Traits\\Macroable' => __DIR__ . '/..' . '/illuminate/macroable/Traits/Macroable.php',
521
+ 'Illuminate\\Support\\Traits\\ReflectsClosures' => __DIR__ . '/..' . '/illuminate/support/Traits/ReflectsClosures.php',
522
+ 'Illuminate\\Support\\Traits\\Tappable' => __DIR__ . '/..' . '/illuminate/support/Traits/Tappable.php',
523
  'Illuminate\\Support\\ViewErrorBag' => __DIR__ . '/..' . '/illuminate/support/ViewErrorBag.php',
524
+ 'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
525
+ 'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
526
+ 'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
527
+ 'Psr\\SimpleCache\\CacheException' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheException.php',
528
+ 'Psr\\SimpleCache\\CacheInterface' => __DIR__ . '/..' . '/psr/simple-cache/src/CacheInterface.php',
529
+ 'Psr\\SimpleCache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/simple-cache/src/InvalidArgumentException.php',
530
  'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
531
  'Symfony\\Component\\Finder\\Comparator\\Comparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/Comparator.php',
532
  'Symfony\\Component\\Finder\\Comparator\\DateComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/DateComparator.php',
533
  'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/NumberComparator.php',
534
  'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => __DIR__ . '/..' . '/symfony/finder/Exception/AccessDeniedException.php',
535
+ 'Symfony\\Component\\Finder\\Exception\\DirectoryNotFoundException' => __DIR__ . '/..' . '/symfony/finder/Exception/DirectoryNotFoundException.php',
536
  'Symfony\\Component\\Finder\\Finder' => __DIR__ . '/..' . '/symfony/finder/Finder.php',
537
+ 'Symfony\\Component\\Finder\\Gitignore' => __DIR__ . '/..' . '/symfony/finder/Gitignore.php',
538
  'Symfony\\Component\\Finder\\Glob' => __DIR__ . '/..' . '/symfony/finder/Glob.php',
539
  'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/CustomFilterIterator.php',
540
  'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/DateRangeFilterIterator.php',
543
  'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FileTypeFilterIterator.php',
544
  'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilecontentFilterIterator.php',
545
  'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilenameFilterIterator.php',
546
+ 'Symfony\\Component\\Finder\\Iterator\\LazyIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/LazyIterator.php',
547
  'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php',
548
  'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/PathFilterIterator.php',
549
  'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php',
627
  'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php',
628
  'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
629
  'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
630
+ 'voku\\helper\\ASCII' => __DIR__ . '/..' . '/voku/portable-ascii/src/voku/helper/ASCII.php',
631
  );
632
 
633
  public static function getInitializer(ClassLoader $loader)
634
  {
635
  return \Closure::bind(function () use ($loader) {
636
+ $loader->prefixLengthsPsr4 = ComposerStaticInit685660b63662e7b4526beec066cc0ce1::$prefixLengthsPsr4;
637
+ $loader->prefixDirsPsr4 = ComposerStaticInit685660b63662e7b4526beec066cc0ce1::$prefixDirsPsr4;
638
+ $loader->classMap = ComposerStaticInit685660b63662e7b4526beec066cc0ce1::$classMap;
639
 
640
  }, null, ClassLoader::class);
641
  }
vendor/composer/installed.json CHANGED
@@ -2,17 +2,17 @@
2
  "packages": [
3
  {
4
  "name": "doctrine/inflector",
5
- "version": "1.4.3",
6
- "version_normalized": "1.4.3.0",
7
  "source": {
8
  "type": "git",
9
  "url": "https://github.com/doctrine/inflector.git",
10
- "reference": "4650c8b30c753a76bf44fb2ed00117d6f367490c"
11
  },
12
  "dist": {
13
  "type": "zip",
14
- "url": "https://api.github.com/repos/doctrine/inflector/zipball/4650c8b30c753a76bf44fb2ed00117d6f367490c",
15
- "reference": "4650c8b30c753a76bf44fb2ed00117d6f367490c",
16
  "shasum": ""
17
  },
18
  "require": {
@@ -25,7 +25,7 @@
25
  "phpstan/phpstan-strict-rules": "^0.11",
26
  "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
27
  },
28
- "time": "2020-05-29T07:19:59+00:00",
29
  "type": "library",
30
  "extra": {
31
  "branch-alias": {
@@ -35,7 +35,6 @@
35
  "installation-source": "dist",
36
  "autoload": {
37
  "psr-4": {
38
- "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector",
39
  "Doctrine\\Inflector\\": "lib/Doctrine/Inflector"
40
  }
41
  },
@@ -81,7 +80,7 @@
81
  ],
82
  "support": {
83
  "issues": "https://github.com/doctrine/inflector/issues",
84
- "source": "https://github.com/doctrine/inflector/tree/1.4.x"
85
  },
86
  "funding": [
87
  {
@@ -99,31 +98,88 @@
99
  ],
100
  "install-path": "../doctrine/inflector"
101
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  {
103
  "name": "illuminate/config",
104
- "version": "v5.4.36",
105
- "version_normalized": "5.4.36.0",
106
  "source": {
107
  "type": "git",
108
  "url": "https://github.com/illuminate/config.git",
109
- "reference": "8fe700aa596bc623d347e4578041fbda7a44c3d9"
110
  },
111
  "dist": {
112
  "type": "zip",
113
- "url": "https://api.github.com/repos/illuminate/config/zipball/8fe700aa596bc623d347e4578041fbda7a44c3d9",
114
- "reference": "8fe700aa596bc623d347e4578041fbda7a44c3d9",
115
  "shasum": ""
116
  },
117
  "require": {
118
- "illuminate/contracts": "5.4.*",
119
- "illuminate/support": "5.4.*",
120
- "php": ">=5.6.4"
121
  },
122
- "time": "2017-02-04T20:27:32+00:00",
123
  "type": "library",
124
  "extra": {
125
  "branch-alias": {
126
- "dev-master": "5.4-dev"
127
  }
128
  },
129
  "installation-source": "dist",
@@ -152,28 +208,32 @@
152
  },
153
  {
154
  "name": "illuminate/container",
155
- "version": "v5.4.36",
156
- "version_normalized": "5.4.36.0",
157
  "source": {
158
  "type": "git",
159
  "url": "https://github.com/illuminate/container.git",
160
- "reference": "c5b8a02a34a52c307f16922334c355c5eef725a6"
161
  },
162
  "dist": {
163
  "type": "zip",
164
- "url": "https://api.github.com/repos/illuminate/container/zipball/c5b8a02a34a52c307f16922334c355c5eef725a6",
165
- "reference": "c5b8a02a34a52c307f16922334c355c5eef725a6",
166
  "shasum": ""
167
  },
168
  "require": {
169
- "illuminate/contracts": "5.4.*",
170
- "php": ">=5.6.4"
 
 
 
 
171
  },
172
- "time": "2017-05-24T14:15:53+00:00",
173
  "type": "library",
174
  "extra": {
175
  "branch-alias": {
176
- "dev-master": "5.4-dev"
177
  }
178
  },
179
  "installation-source": "dist",
@@ -202,27 +262,29 @@
202
  },
203
  {
204
  "name": "illuminate/contracts",
205
- "version": "v5.4.36",
206
- "version_normalized": "5.4.36.0",
207
  "source": {
208
  "type": "git",
209
  "url": "https://github.com/illuminate/contracts.git",
210
- "reference": "67f642e018f3e95fb0b2ebffc206c3200391b1ab"
211
  },
212
  "dist": {
213
  "type": "zip",
214
- "url": "https://api.github.com/repos/illuminate/contracts/zipball/67f642e018f3e95fb0b2ebffc206c3200391b1ab",
215
- "reference": "67f642e018f3e95fb0b2ebffc206c3200391b1ab",
216
  "shasum": ""
217
  },
218
  "require": {
219
- "php": ">=5.6.4"
 
 
220
  },
221
- "time": "2017-08-26T23:56:53+00:00",
222
  "type": "library",
223
  "extra": {
224
  "branch-alias": {
225
- "dev-master": "5.4-dev"
226
  }
227
  },
228
  "installation-source": "dist",
@@ -251,35 +313,43 @@
251
  },
252
  {
253
  "name": "illuminate/filesystem",
254
- "version": "v5.4.36",
255
- "version_normalized": "5.4.36.0",
256
  "source": {
257
  "type": "git",
258
  "url": "https://github.com/illuminate/filesystem.git",
259
- "reference": "b800a1423d06869ee5c2768eee123917f12b693e"
260
  },
261
  "dist": {
262
  "type": "zip",
263
- "url": "https://api.github.com/repos/illuminate/filesystem/zipball/b800a1423d06869ee5c2768eee123917f12b693e",
264
- "reference": "b800a1423d06869ee5c2768eee123917f12b693e",
265
  "shasum": ""
266
  },
267
  "require": {
268
- "illuminate/contracts": "5.4.*",
269
- "illuminate/support": "5.4.*",
270
- "php": ">=5.6.4",
271
- "symfony/finder": "~3.2"
 
 
272
  },
273
  "suggest": {
274
- "league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).",
275
- "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).",
276
- "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0)."
277
- },
278
- "time": "2017-08-02T21:58:00+00:00",
 
 
 
 
 
 
279
  "type": "library",
280
  "extra": {
281
  "branch-alias": {
282
- "dev-master": "5.4-dev"
283
  }
284
  },
285
  "installation-source": "dist",
@@ -306,41 +376,97 @@
306
  },
307
  "install-path": "../illuminate/filesystem"
308
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  {
310
  "name": "illuminate/support",
311
- "version": "v5.4.36",
312
- "version_normalized": "5.4.36.0",
313
  "source": {
314
  "type": "git",
315
  "url": "https://github.com/illuminate/support.git",
316
- "reference": "feab1d1495fd6d38970bd6c83586ba2ace8f299a"
317
  },
318
  "dist": {
319
  "type": "zip",
320
- "url": "https://api.github.com/repos/illuminate/support/zipball/feab1d1495fd6d38970bd6c83586ba2ace8f299a",
321
- "reference": "feab1d1495fd6d38970bd6c83586ba2ace8f299a",
322
  "shasum": ""
323
  },
324
  "require": {
325
- "doctrine/inflector": "~1.1",
 
326
  "ext-mbstring": "*",
327
- "illuminate/contracts": "5.4.*",
328
- "paragonie/random_compat": "~1.4|~2.0",
329
- "php": ">=5.6.4"
 
 
 
330
  },
331
- "replace": {
332
- "tightenco/collect": "self.version"
333
  },
334
  "suggest": {
335
- "illuminate/filesystem": "Required to use the composer class (5.2.*).",
336
- "symfony/process": "Required to use the composer class (~3.2).",
337
- "symfony/var-dumper": "Required to use the dd function (~3.2)."
338
- },
339
- "time": "2017-08-15T13:25:41+00:00",
 
 
 
340
  "type": "library",
341
  "extra": {
342
  "branch-alias": {
343
- "dev-master": "5.4-dev"
344
  }
345
  },
346
  "installation-source": "dist",
@@ -467,36 +593,86 @@
467
  "install-path": "../nesbot/carbon"
468
  },
469
  {
470
- "name": "paragonie/random_compat",
471
- "version": "v2.0.19",
472
- "version_normalized": "2.0.19.0",
473
  "source": {
474
  "type": "git",
475
- "url": "https://github.com/paragonie/random_compat.git",
476
- "reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241"
477
  },
478
  "dist": {
479
  "type": "zip",
480
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/446fc9faa5c2a9ddf65eb7121c0af7e857295241",
481
- "reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241",
482
  "shasum": ""
483
  },
484
  "require": {
485
- "php": ">=5.2.0"
486
  },
487
- "require-dev": {
488
- "phpunit/phpunit": "4.*|5.*"
 
 
 
 
 
489
  },
490
- "suggest": {
491
- "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  },
493
- "time": "2020-10-15T10:06:57+00:00",
 
 
 
494
  "type": "library",
 
 
 
 
 
495
  "installation-source": "dist",
496
  "autoload": {
497
- "files": [
498
- "lib/random.php"
499
- ]
500
  },
501
  "notification-url": "https://packagist.org/downloads/",
502
  "license": [
@@ -504,44 +680,42 @@
504
  ],
505
  "authors": [
506
  {
507
- "name": "Paragon Initiative Enterprises",
508
- "email": "security@paragonie.com",
509
- "homepage": "https://paragonie.com"
510
  }
511
  ],
512
- "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
513
  "keywords": [
514
- "csprng",
515
- "polyfill",
516
- "pseudorandom",
517
- "random"
 
518
  ],
519
  "support": {
520
- "email": "info@paragonie.com",
521
- "issues": "https://github.com/paragonie/random_compat/issues",
522
- "source": "https://github.com/paragonie/random_compat"
523
  },
524
- "install-path": "../paragonie/random_compat"
525
  },
526
  {
527
  "name": "symfony/finder",
528
- "version": "v3.4.47",
529
- "version_normalized": "3.4.47.0",
530
  "source": {
531
  "type": "git",
532
  "url": "https://github.com/symfony/finder.git",
533
- "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e"
534
  },
535
  "dist": {
536
  "type": "zip",
537
- "url": "https://api.github.com/repos/symfony/finder/zipball/b6b6ad3db3edb1b4b1c1896b1975fb684994de6e",
538
- "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e",
539
  "shasum": ""
540
  },
541
  "require": {
542
- "php": "^5.5.9|>=7.0.8"
543
  },
544
- "time": "2020-11-16T17:02:08+00:00",
545
  "type": "library",
546
  "installation-source": "dist",
547
  "autoload": {
@@ -566,10 +740,10 @@
566
  "homepage": "https://symfony.com/contributors"
567
  }
568
  ],
569
- "description": "Symfony Finder Component",
570
  "homepage": "https://symfony.com",
571
  "support": {
572
- "source": "https://github.com/symfony/finder/tree/v3.4.47"
573
  },
574
  "funding": [
575
  {
@@ -932,6 +1106,83 @@
932
  }
933
  ],
934
  "install-path": "../symfony/translation-contracts"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
935
  }
936
  ],
937
  "dev": false,
2
  "packages": [
3
  {
4
  "name": "doctrine/inflector",
5
+ "version": "2.0.3",
6
+ "version_normalized": "2.0.3.0",
7
  "source": {
8
  "type": "git",
9
  "url": "https://github.com/doctrine/inflector.git",
10
+ "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210"
11
  },
12
  "dist": {
13
  "type": "zip",
14
+ "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210",
15
+ "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210",
16
  "shasum": ""
17
  },
18
  "require": {
25
  "phpstan/phpstan-strict-rules": "^0.11",
26
  "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
27
  },
28
+ "time": "2020-05-29T15:13:26+00:00",
29
  "type": "library",
30
  "extra": {
31
  "branch-alias": {
35
  "installation-source": "dist",
36
  "autoload": {
37
  "psr-4": {
 
38
  "Doctrine\\Inflector\\": "lib/Doctrine/Inflector"
39
  }
40
  },
80
  ],
81
  "support": {
82
  "issues": "https://github.com/doctrine/inflector/issues",
83
+ "source": "https://github.com/doctrine/inflector/tree/2.0.x"
84
  },
85
  "funding": [
86
  {
98
  ],
99
  "install-path": "../doctrine/inflector"
100
  },
101
+ {
102
+ "name": "illuminate/collections",
103
+ "version": "v8.36.2",
104
+ "version_normalized": "8.36.2.0",
105
+ "source": {
106
+ "type": "git",
107
+ "url": "https://github.com/illuminate/collections.git",
108
+ "reference": "591e31015a8b0731708c54411cb52d50a00b2bc3"
109
+ },
110
+ "dist": {
111
+ "type": "zip",
112
+ "url": "https://api.github.com/repos/illuminate/collections/zipball/591e31015a8b0731708c54411cb52d50a00b2bc3",
113
+ "reference": "591e31015a8b0731708c54411cb52d50a00b2bc3",
114
+ "shasum": ""
115
+ },
116
+ "require": {
117
+ "illuminate/contracts": "^8.0",
118
+ "illuminate/macroable": "^8.0",
119
+ "php": "^7.3|^8.0"
120
+ },
121
+ "suggest": {
122
+ "symfony/var-dumper": "Required to use the dump method (^5.1.4)."
123
+ },
124
+ "time": "2021-04-01T13:26:52+00:00",
125
+ "type": "library",
126
+ "extra": {
127
+ "branch-alias": {
128
+ "dev-master": "8.x-dev"
129
+ }
130
+ },
131
+ "installation-source": "dist",
132
+ "autoload": {
133
+ "psr-4": {
134
+ "Illuminate\\Support\\": ""
135
+ },
136
+ "files": [
137
+ "helpers.php"
138
+ ]
139
+ },
140
+ "notification-url": "https://packagist.org/downloads/",
141
+ "license": [
142
+ "MIT"
143
+ ],
144
+ "authors": [
145
+ {
146
+ "name": "Taylor Otwell",
147
+ "email": "taylor@laravel.com"
148
+ }
149
+ ],
150
+ "description": "The Illuminate Collections package.",
151
+ "homepage": "https://laravel.com",
152
+ "support": {
153
+ "issues": "https://github.com/laravel/framework/issues",
154
+ "source": "https://github.com/laravel/framework"
155
+ },
156
+ "install-path": "../illuminate/collections"
157
+ },
158
  {
159
  "name": "illuminate/config",
160
+ "version": "v8.36.2",
161
+ "version_normalized": "8.36.2.0",
162
  "source": {
163
  "type": "git",
164
  "url": "https://github.com/illuminate/config.git",
165
+ "reference": "8441c542312b4d57220b1f942b947b6517c05008"
166
  },
167
  "dist": {
168
  "type": "zip",
169
+ "url": "https://api.github.com/repos/illuminate/config/zipball/8441c542312b4d57220b1f942b947b6517c05008",
170
+ "reference": "8441c542312b4d57220b1f942b947b6517c05008",
171
  "shasum": ""
172
  },
173
  "require": {
174
+ "illuminate/collections": "^8.0",
175
+ "illuminate/contracts": "^8.0",
176
+ "php": "^7.3|^8.0"
177
  },
178
+ "time": "2020-10-27T15:20:30+00:00",
179
  "type": "library",
180
  "extra": {
181
  "branch-alias": {
182
+ "dev-master": "8.x-dev"
183
  }
184
  },
185
  "installation-source": "dist",
208
  },
209
  {
210
  "name": "illuminate/container",
211
+ "version": "v8.36.2",
212
+ "version_normalized": "8.36.2.0",
213
  "source": {
214
  "type": "git",
215
  "url": "https://github.com/illuminate/container.git",
216
+ "reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e"
217
  },
218
  "dist": {
219
  "type": "zip",
220
+ "url": "https://api.github.com/repos/illuminate/container/zipball/0e38ee1632d470e56aece0079e6e22d13e6bea8e",
221
+ "reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e",
222
  "shasum": ""
223
  },
224
  "require": {
225
+ "illuminate/contracts": "^8.0",
226
+ "php": "^7.3|^8.0",
227
+ "psr/container": "^1.0"
228
+ },
229
+ "provide": {
230
+ "psr/container-implementation": "1.0"
231
  },
232
+ "time": "2021-03-16T19:42:20+00:00",
233
  "type": "library",
234
  "extra": {
235
  "branch-alias": {
236
+ "dev-master": "8.x-dev"
237
  }
238
  },
239
  "installation-source": "dist",
262
  },
263
  {
264
  "name": "illuminate/contracts",
265
+ "version": "v8.36.2",
266
+ "version_normalized": "8.36.2.0",
267
  "source": {
268
  "type": "git",
269
  "url": "https://github.com/illuminate/contracts.git",
270
+ "reference": "5764f703ea8f74ced163125d810951cd5ef2b7e1"
271
  },
272
  "dist": {
273
  "type": "zip",
274
+ "url": "https://api.github.com/repos/illuminate/contracts/zipball/5764f703ea8f74ced163125d810951cd5ef2b7e1",
275
+ "reference": "5764f703ea8f74ced163125d810951cd5ef2b7e1",
276
  "shasum": ""
277
  },
278
  "require": {
279
+ "php": "^7.3|^8.0",
280
+ "psr/container": "^1.0",
281
+ "psr/simple-cache": "^1.0"
282
  },
283
+ "time": "2021-04-01T13:09:31+00:00",
284
  "type": "library",
285
  "extra": {
286
  "branch-alias": {
287
+ "dev-master": "8.x-dev"
288
  }
289
  },
290
  "installation-source": "dist",
313
  },
314
  {
315
  "name": "illuminate/filesystem",
316
+ "version": "v8.36.2",
317
+ "version_normalized": "8.36.2.0",
318
  "source": {
319
  "type": "git",
320
  "url": "https://github.com/illuminate/filesystem.git",
321
+ "reference": "8ef5902052c5b3bb4a6c1c3afc399f30e7723cb8"
322
  },
323
  "dist": {
324
  "type": "zip",
325
+ "url": "https://api.github.com/repos/illuminate/filesystem/zipball/8ef5902052c5b3bb4a6c1c3afc399f30e7723cb8",
326
+ "reference": "8ef5902052c5b3bb4a6c1c3afc399f30e7723cb8",
327
  "shasum": ""
328
  },
329
  "require": {
330
+ "illuminate/collections": "^8.0",
331
+ "illuminate/contracts": "^8.0",
332
+ "illuminate/macroable": "^8.0",
333
+ "illuminate/support": "^8.0",
334
+ "php": "^7.3|^8.0",
335
+ "symfony/finder": "^5.1.4"
336
  },
337
  "suggest": {
338
+ "ext-ftp": "Required to use the Flysystem FTP driver.",
339
+ "illuminate/http": "Required for handling uploaded files (^7.0).",
340
+ "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).",
341
+ "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).",
342
+ "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).",
343
+ "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).",
344
+ "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
345
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).",
346
+ "symfony/mime": "Required to enable support for guessing extensions (^5.1.4)."
347
+ },
348
+ "time": "2021-04-05T18:45:36+00:00",
349
  "type": "library",
350
  "extra": {
351
  "branch-alias": {
352
+ "dev-master": "8.x-dev"
353
  }
354
  },
355
  "installation-source": "dist",
376
  },
377
  "install-path": "../illuminate/filesystem"
378
  },
379
+ {
380
+ "name": "illuminate/macroable",
381
+ "version": "v8.36.2",
382
+ "version_normalized": "8.36.2.0",
383
+ "source": {
384
+ "type": "git",
385
+ "url": "https://github.com/illuminate/macroable.git",
386
+ "reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05"
387
+ },
388
+ "dist": {
389
+ "type": "zip",
390
+ "url": "https://api.github.com/repos/illuminate/macroable/zipball/300aa13c086f25116b5f3cde3ca54ff5c822fb05",
391
+ "reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05",
392
+ "shasum": ""
393
+ },
394
+ "require": {
395
+ "php": "^7.3|^8.0"
396
+ },
397
+ "time": "2020-10-27T15:20:30+00:00",
398
+ "type": "library",
399
+ "extra": {
400
+ "branch-alias": {
401
+ "dev-master": "8.x-dev"
402
+ }
403
+ },
404
+ "installation-source": "dist",
405
+ "autoload": {
406
+ "psr-4": {
407
+ "Illuminate\\Support\\": ""
408
+ }
409
+ },
410
+ "notification-url": "https://packagist.org/downloads/",
411
+ "license": [
412
+ "MIT"
413
+ ],
414
+ "authors": [
415
+ {
416
+ "name": "Taylor Otwell",
417
+ "email": "taylor@laravel.com"
418
+ }
419
+ ],
420
+ "description": "The Illuminate Macroable package.",
421
+ "homepage": "https://laravel.com",
422
+ "support": {
423
+ "issues": "https://github.com/laravel/framework/issues",
424
+ "source": "https://github.com/laravel/framework"
425
+ },
426
+ "install-path": "../illuminate/macroable"
427
+ },
428
  {
429
  "name": "illuminate/support",
430
+ "version": "v8.36.2",
431
+ "version_normalized": "8.36.2.0",
432
  "source": {
433
  "type": "git",
434
  "url": "https://github.com/illuminate/support.git",
435
+ "reference": "26aa01648f348df7b7988ee911cdf98bcaae8ea1"
436
  },
437
  "dist": {
438
  "type": "zip",
439
+ "url": "https://api.github.com/repos/illuminate/support/zipball/26aa01648f348df7b7988ee911cdf98bcaae8ea1",
440
+ "reference": "26aa01648f348df7b7988ee911cdf98bcaae8ea1",
441
  "shasum": ""
442
  },
443
  "require": {
444
+ "doctrine/inflector": "^1.4|^2.0",
445
+ "ext-json": "*",
446
  "ext-mbstring": "*",
447
+ "illuminate/collections": "^8.0",
448
+ "illuminate/contracts": "^8.0",
449
+ "illuminate/macroable": "^8.0",
450
+ "nesbot/carbon": "^2.31",
451
+ "php": "^7.3|^8.0",
452
+ "voku/portable-ascii": "^1.4.8"
453
  },
454
+ "conflict": {
455
+ "tightenco/collect": "<5.5.33"
456
  },
457
  "suggest": {
458
+ "illuminate/filesystem": "Required to use the composer class (^8.0).",
459
+ "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3).",
460
+ "ramsey/uuid": "Required to use Str::uuid() (^4.0).",
461
+ "symfony/process": "Required to use the composer class (^5.1.4).",
462
+ "symfony/var-dumper": "Required to use the dd function (^5.1.4).",
463
+ "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)."
464
+ },
465
+ "time": "2021-04-06T13:05:53+00:00",
466
  "type": "library",
467
  "extra": {
468
  "branch-alias": {
469
+ "dev-master": "8.x-dev"
470
  }
471
  },
472
  "installation-source": "dist",
593
  "install-path": "../nesbot/carbon"
594
  },
595
  {
596
+ "name": "psr/container",
597
+ "version": "1.1.1",
598
+ "version_normalized": "1.1.1.0",
599
  "source": {
600
  "type": "git",
601
+ "url": "https://github.com/php-fig/container.git",
602
+ "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
603
  },
604
  "dist": {
605
  "type": "zip",
606
+ "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
607
+ "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
608
  "shasum": ""
609
  },
610
  "require": {
611
+ "php": ">=7.2.0"
612
  },
613
+ "time": "2021-03-05T17:36:06+00:00",
614
+ "type": "library",
615
+ "installation-source": "dist",
616
+ "autoload": {
617
+ "psr-4": {
618
+ "Psr\\Container\\": "src/"
619
+ }
620
  },
621
+ "notification-url": "https://packagist.org/downloads/",
622
+ "license": [
623
+ "MIT"
624
+ ],
625
+ "authors": [
626
+ {
627
+ "name": "PHP-FIG",
628
+ "homepage": "https://www.php-fig.org/"
629
+ }
630
+ ],
631
+ "description": "Common Container Interface (PHP FIG PSR-11)",
632
+ "homepage": "https://github.com/php-fig/container",
633
+ "keywords": [
634
+ "PSR-11",
635
+ "container",
636
+ "container-interface",
637
+ "container-interop",
638
+ "psr"
639
+ ],
640
+ "support": {
641
+ "issues": "https://github.com/php-fig/container/issues",
642
+ "source": "https://github.com/php-fig/container/tree/1.1.1"
643
+ },
644
+ "install-path": "../psr/container"
645
+ },
646
+ {
647
+ "name": "psr/simple-cache",
648
+ "version": "1.0.1",
649
+ "version_normalized": "1.0.1.0",
650
+ "source": {
651
+ "type": "git",
652
+ "url": "https://github.com/php-fig/simple-cache.git",
653
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
654
+ },
655
+ "dist": {
656
+ "type": "zip",
657
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
658
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
659
+ "shasum": ""
660
  },
661
+ "require": {
662
+ "php": ">=5.3.0"
663
+ },
664
+ "time": "2017-10-23T01:57:42+00:00",
665
  "type": "library",
666
+ "extra": {
667
+ "branch-alias": {
668
+ "dev-master": "1.0.x-dev"
669
+ }
670
+ },
671
  "installation-source": "dist",
672
  "autoload": {
673
+ "psr-4": {
674
+ "Psr\\SimpleCache\\": "src/"
675
+ }
676
  },
677
  "notification-url": "https://packagist.org/downloads/",
678
  "license": [
680
  ],
681
  "authors": [
682
  {
683
+ "name": "PHP-FIG",
684
+ "homepage": "http://www.php-fig.org/"
 
685
  }
686
  ],
687
+ "description": "Common interfaces for simple caching",
688
  "keywords": [
689
+ "cache",
690
+ "caching",
691
+ "psr",
692
+ "psr-16",
693
+ "simple-cache"
694
  ],
695
  "support": {
696
+ "source": "https://github.com/php-fig/simple-cache/tree/master"
 
 
697
  },
698
+ "install-path": "../psr/simple-cache"
699
  },
700
  {
701
  "name": "symfony/finder",
702
+ "version": "v5.2.4",
703
+ "version_normalized": "5.2.4.0",
704
  "source": {
705
  "type": "git",
706
  "url": "https://github.com/symfony/finder.git",
707
+ "reference": "0d639a0943822626290d169965804f79400e6a04"
708
  },
709
  "dist": {
710
  "type": "zip",
711
+ "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04",
712
+ "reference": "0d639a0943822626290d169965804f79400e6a04",
713
  "shasum": ""
714
  },
715
  "require": {
716
+ "php": ">=7.2.5"
717
  },
718
+ "time": "2021-02-15T18:55:04+00:00",
719
  "type": "library",
720
  "installation-source": "dist",
721
  "autoload": {
740
  "homepage": "https://symfony.com/contributors"
741
  }
742
  ],
743
+ "description": "Finds files and directories via an intuitive fluent interface",
744
  "homepage": "https://symfony.com",
745
  "support": {
746
+ "source": "https://github.com/symfony/finder/tree/v5.2.4"
747
  },
748
  "funding": [
749
  {
1106
  }
1107
  ],
1108
  "install-path": "../symfony/translation-contracts"
1109
+ },
1110
+ {
1111
+ "name": "voku/portable-ascii",
1112
+ "version": "1.5.6",
1113
+ "version_normalized": "1.5.6.0",
1114
+ "source": {
1115
+ "type": "git",
1116
+ "url": "https://github.com/voku/portable-ascii.git",
1117
+ "reference": "80953678b19901e5165c56752d087fc11526017c"
1118
+ },
1119
+ "dist": {
1120
+ "type": "zip",
1121
+ "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c",
1122
+ "reference": "80953678b19901e5165c56752d087fc11526017c",
1123
+ "shasum": ""
1124
+ },
1125
+ "require": {
1126
+ "php": ">=7.0.0"
1127
+ },
1128
+ "require-dev": {
1129
+ "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
1130
+ },
1131
+ "suggest": {
1132
+ "ext-intl": "Use Intl for transliterator_transliterate() support"
1133
+ },
1134
+ "time": "2020-11-12T00:07:28+00:00",
1135
+ "type": "library",
1136
+ "installation-source": "dist",
1137
+ "autoload": {
1138
+ "psr-4": {
1139
+ "voku\\": "src/voku/"
1140
+ }
1141
+ },
1142
+ "notification-url": "https://packagist.org/downloads/",
1143
+ "license": [
1144
+ "MIT"
1145
+ ],
1146
+ "authors": [
1147
+ {
1148
+ "name": "Lars Moelleken",
1149
+ "homepage": "http://www.moelleken.org/"
1150
+ }
1151
+ ],
1152
+ "description": "Portable ASCII library - performance optimized (ascii) string functions for php.",
1153
+ "homepage": "https://github.com/voku/portable-ascii",
1154
+ "keywords": [
1155
+ "ascii",
1156
+ "clean",
1157
+ "php"
1158
+ ],
1159
+ "support": {
1160
+ "issues": "https://github.com/voku/portable-ascii/issues",
1161
+ "source": "https://github.com/voku/portable-ascii/tree/1.5.6"
1162
+ },
1163
+ "funding": [
1164
+ {
1165
+ "url": "https://www.paypal.me/moelleken",
1166
+ "type": "custom"
1167
+ },
1168
+ {
1169
+ "url": "https://github.com/voku",
1170
+ "type": "github"
1171
+ },
1172
+ {
1173
+ "url": "https://opencollective.com/portable-ascii",
1174
+ "type": "open_collective"
1175
+ },
1176
+ {
1177
+ "url": "https://www.patreon.com/voku",
1178
+ "type": "patreon"
1179
+ },
1180
+ {
1181
+ "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii",
1182
+ "type": "tidelift"
1183
+ }
1184
+ ],
1185
+ "install-path": "../voku/portable-ascii"
1186
  }
1187
  ],
1188
  "dev": false,
vendor/composer/installed.php CHANGED
@@ -1,78 +1,96 @@
1
  <?php return array (
2
  'root' =>
3
  array (
4
- 'pretty_version' => '1.0.0+no-version-set',
5
- 'version' => '1.0.0.0',
6
  'aliases' =>
7
  array (
8
  ),
9
- 'reference' => NULL,
10
  'name' => '__root__',
11
  ),
12
  'versions' =>
13
  array (
14
  '__root__' =>
15
  array (
16
- 'pretty_version' => '1.0.0+no-version-set',
17
- 'version' => '1.0.0.0',
18
  'aliases' =>
19
  array (
20
  ),
21
- 'reference' => NULL,
22
  ),
23
  'doctrine/inflector' =>
24
  array (
25
- 'pretty_version' => '1.4.3',
26
- 'version' => '1.4.3.0',
27
  'aliases' =>
28
  array (
29
  ),
30
- 'reference' => '4650c8b30c753a76bf44fb2ed00117d6f367490c',
 
 
 
 
 
 
 
 
 
31
  ),
32
  'illuminate/config' =>
33
  array (
34
- 'pretty_version' => 'v5.4.36',
35
- 'version' => '5.4.36.0',
36
  'aliases' =>
37
  array (
38
  ),
39
- 'reference' => '8fe700aa596bc623d347e4578041fbda7a44c3d9',
40
  ),
41
  'illuminate/container' =>
42
  array (
43
- 'pretty_version' => 'v5.4.36',
44
- 'version' => '5.4.36.0',
45
  'aliases' =>
46
  array (
47
  ),
48
- 'reference' => 'c5b8a02a34a52c307f16922334c355c5eef725a6',
49
  ),
50
  'illuminate/contracts' =>
51
  array (
52
- 'pretty_version' => 'v5.4.36',
53
- 'version' => '5.4.36.0',
54
  'aliases' =>
55
  array (
56
  ),
57
- 'reference' => '67f642e018f3e95fb0b2ebffc206c3200391b1ab',
58
  ),
59
  'illuminate/filesystem' =>
60
  array (
61
- 'pretty_version' => 'v5.4.36',
62
- 'version' => '5.4.36.0',
63
  'aliases' =>
64
  array (
65
  ),
66
- 'reference' => 'b800a1423d06869ee5c2768eee123917f12b693e',
 
 
 
 
 
 
 
 
 
67
  ),
68
  'illuminate/support' =>
69
  array (
70
- 'pretty_version' => 'v5.4.36',
71
- 'version' => '5.4.36.0',
72
  'aliases' =>
73
  array (
74
  ),
75
- 'reference' => 'feab1d1495fd6d38970bd6c83586ba2ace8f299a',
76
  ),
77
  'nesbot/carbon' =>
78
  array (
@@ -83,23 +101,39 @@
83
  ),
84
  'reference' => '2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4',
85
  ),
86
- 'paragonie/random_compat' =>
87
  array (
88
- 'pretty_version' => 'v2.0.19',
89
- 'version' => '2.0.19.0',
90
  'aliases' =>
91
  array (
92
  ),
93
- 'reference' => '446fc9faa5c2a9ddf65eb7121c0af7e857295241',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  ),
95
  'symfony/finder' =>
96
  array (
97
- 'pretty_version' => 'v3.4.47',
98
- 'version' => '3.4.47.0',
99
  'aliases' =>
100
  array (
101
  ),
102
- 'reference' => 'b6b6ad3db3edb1b4b1c1896b1975fb684994de6e',
103
  ),
104
  'symfony/polyfill-mbstring' =>
105
  array (
@@ -144,12 +178,14 @@
144
  0 => '2.3',
145
  ),
146
  ),
147
- 'tightenco/collect' =>
148
  array (
149
- 'replaced' =>
 
 
150
  array (
151
- 0 => 'v5.4.36',
152
  ),
 
153
  ),
154
  ),
155
  );
1
  <?php return array (
2
  'root' =>
3
  array (
4
+ 'pretty_version' => 'dev-master',
5
+ 'version' => 'dev-master',
6
  'aliases' =>
7
  array (
8
  ),
9
+ 'reference' => 'c18157ed38570a3ea413e8e4717879c312c07e9f',
10
  'name' => '__root__',
11
  ),
12
  'versions' =>
13
  array (
14
  '__root__' =>
15
  array (
16
+ 'pretty_version' => 'dev-master',
17
+ 'version' => 'dev-master',
18
  'aliases' =>
19
  array (
20
  ),
21
+ 'reference' => 'c18157ed38570a3ea413e8e4717879c312c07e9f',
22
  ),
23
  'doctrine/inflector' =>
24
  array (
25
+ 'pretty_version' => '2.0.3',
26
+ 'version' => '2.0.3.0',
27
  'aliases' =>
28
  array (
29
  ),
30
+ 'reference' => '9cf661f4eb38f7c881cac67c75ea9b00bf97b210',
31
+ ),
32
+ 'illuminate/collections' =>
33
+ array (
34
+ 'pretty_version' => 'v8.36.2',
35
+ 'version' => '8.36.2.0',
36
+ 'aliases' =>
37
+ array (
38
+ ),
39
+ 'reference' => '591e31015a8b0731708c54411cb52d50a00b2bc3',
40
  ),
41
  'illuminate/config' =>
42
  array (
43
+ 'pretty_version' => 'v8.36.2',
44
+ 'version' => '8.36.2.0',
45
  'aliases' =>
46
  array (
47
  ),
48
+ 'reference' => '8441c542312b4d57220b1f942b947b6517c05008',
49
  ),
50
  'illuminate/container' =>
51
  array (
52
+ 'pretty_version' => 'v8.36.2',
53
+ 'version' => '8.36.2.0',
54
  'aliases' =>
55
  array (
56
  ),
57
+ 'reference' => '0e38ee1632d470e56aece0079e6e22d13e6bea8e',
58
  ),
59
  'illuminate/contracts' =>
60
  array (
61
+ 'pretty_version' => 'v8.36.2',
62
+ 'version' => '8.36.2.0',
63
  'aliases' =>
64
  array (
65
  ),
66
+ 'reference' => '5764f703ea8f74ced163125d810951cd5ef2b7e1',
67
  ),
68
  'illuminate/filesystem' =>
69
  array (
70
+ 'pretty_version' => 'v8.36.2',
71
+ 'version' => '8.36.2.0',
72
  'aliases' =>
73
  array (
74
  ),
75
+ 'reference' => '8ef5902052c5b3bb4a6c1c3afc399f30e7723cb8',
76
+ ),
77
+ 'illuminate/macroable' =>
78
+ array (
79
+ 'pretty_version' => 'v8.36.2',
80
+ 'version' => '8.36.2.0',
81
+ 'aliases' =>
82
+ array (
83
+ ),
84
+ 'reference' => '300aa13c086f25116b5f3cde3ca54ff5c822fb05',
85
  ),
86
  'illuminate/support' =>
87
  array (
88
+ 'pretty_version' => 'v8.36.2',
89
+ 'version' => '8.36.2.0',
90
  'aliases' =>
91
  array (
92
  ),
93
+ 'reference' => '26aa01648f348df7b7988ee911cdf98bcaae8ea1',
94
  ),
95
  'nesbot/carbon' =>
96
  array (
101
  ),
102
  'reference' => '2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4',
103
  ),
104
+ 'psr/container' =>
105
  array (
106
+ 'pretty_version' => '1.1.1',
107
+ 'version' => '1.1.1.0',
108
  'aliases' =>
109
  array (
110
  ),
111
+ 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
112
+ ),
113
+ 'psr/container-implementation' =>
114
+ array (
115
+ 'provided' =>
116
+ array (
117
+ 0 => '1.0',
118
+ ),
119
+ ),
120
+ 'psr/simple-cache' =>
121
+ array (
122
+ 'pretty_version' => '1.0.1',
123
+ 'version' => '1.0.1.0',
124
+ 'aliases' =>
125
+ array (
126
+ ),
127
+ 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
128
  ),
129
  'symfony/finder' =>
130
  array (
131
+ 'pretty_version' => 'v5.2.4',
132
+ 'version' => '5.2.4.0',
133
  'aliases' =>
134
  array (
135
  ),
136
+ 'reference' => '0d639a0943822626290d169965804f79400e6a04',
137
  ),
138
  'symfony/polyfill-mbstring' =>
139
  array (
178
  0 => '2.3',
179
  ),
180
  ),
181
+ 'voku/portable-ascii' =>
182
  array (
183
+ 'pretty_version' => '1.5.6',
184
+ 'version' => '1.5.6.0',
185
+ 'aliases' =>
186
  array (
 
187
  ),
188
+ 'reference' => '80953678b19901e5165c56752d087fc11526017c',
189
  ),
190
  ),
191
  );
vendor/composer/platform_check.php CHANGED
@@ -4,8 +4,8 @@
4
 
5
  $issues = array();
6
 
7
- if (!(PHP_VERSION_ID >= 70205)) {
8
- $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.';
9
  }
10
 
11
  if ($issues) {
4
 
5
  $issues = array();
6
 
7
+ if (!(PHP_VERSION_ID >= 70300)) {
8
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.';
9
  }
10
 
11
  if ($issues) {
vendor/doctrine/inflector/composer.json CHANGED
@@ -24,13 +24,11 @@
24
  },
25
  "autoload": {
26
  "psr-4": {
27
- "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector",
28
  "Doctrine\\Inflector\\": "lib/Doctrine/Inflector"
29
  }
30
  },
31
  "autoload-dev": {
32
  "psr-4": {
33
- "Doctrine\\Tests\\Common\\Inflector\\": "tests/Doctrine/Tests/Common/Inflector",
34
  "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector"
35
  }
36
  },
24
  },
25
  "autoload": {
26
  "psr-4": {
 
27
  "Doctrine\\Inflector\\": "lib/Doctrine/Inflector"
28
  }
29
  },
30
  "autoload-dev": {
31
  "psr-4": {
 
32
  "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector"
33
  }
34
  },
vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php DELETED
@@ -1,281 +0,0 @@
1
- <?php
2
- /*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the MIT license. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
- namespace Doctrine\Common\Inflector;
21
-
22
- use Doctrine\Inflector\Inflector as InflectorObject;
23
- use Doctrine\Inflector\InflectorFactory;
24
- use Doctrine\Inflector\LanguageInflectorFactory;
25
- use Doctrine\Inflector\Rules\Pattern;
26
- use Doctrine\Inflector\Rules\Patterns;
27
- use Doctrine\Inflector\Rules\Ruleset;
28
- use Doctrine\Inflector\Rules\Substitution;
29
- use Doctrine\Inflector\Rules\Substitutions;
30
- use Doctrine\Inflector\Rules\Transformation;
31
- use Doctrine\Inflector\Rules\Transformations;
32
- use Doctrine\Inflector\Rules\Word;
33
- use InvalidArgumentException;
34
- use function array_keys;
35
- use function array_map;
36
- use function array_unshift;
37
- use function array_values;
38
- use function sprintf;
39
- use function trigger_error;
40
- use const E_USER_DEPRECATED;
41
-
42
- /**
43
- * @deprecated
44
- */
45
- class Inflector
46
- {
47
- /**
48
- * @var LanguageInflectorFactory|null
49
- */
50
- private static $factory;
51
-
52
- /** @var InflectorObject|null */
53
- private static $instance;
54
-
55
- private static function getInstance() : InflectorObject
56
- {
57
- if (self::$factory === null) {
58
- self::$factory = self::createFactory();
59
- }
60
-
61
- if (self::$instance === null) {
62
- self::$instance = self::$factory->build();
63
- }
64
-
65
- return self::$instance;
66
- }
67
-
68
- private static function createFactory() : LanguageInflectorFactory
69
- {
70
- return InflectorFactory::create();
71
- }
72
-
73
- /**
74
- * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'.
75
- *
76
- * @deprecated
77
- */
78
- public static function tableize(string $word) : string
79
- {
80
- @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
81
-
82
- return self::getInstance()->tableize($word);
83
- }
84
-
85
- /**
86
- * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'.
87
- */
88
- public static function classify(string $word) : string
89
- {
90
- @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
91
-
92
- return self::getInstance()->classify($word);
93
- }
94
-
95
- /**
96
- * Camelizes a word. This uses the classify() method and turns the first character to lowercase.
97
- *
98
- * @deprecated
99
- */
100
- public static function camelize(string $word) : string
101
- {
102
- @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
103
-
104
- return self::getInstance()->camelize($word);
105
- }
106
-
107
- /**
108
- * Uppercases words with configurable delimiters between words.
109
- *
110
- * Takes a string and capitalizes all of the words, like PHP's built-in
111
- * ucwords function. This extends that behavior, however, by allowing the
112
- * word delimiters to be configured, rather than only separating on
113
- * whitespace.
114
- *
115
- * Here is an example:
116
- * <code>
117
- * <?php
118
- * $string = 'top-o-the-morning to all_of_you!';
119
- * echo \Doctrine\Common\Inflector\Inflector::ucwords($string);
120
- * // Top-O-The-Morning To All_of_you!
121
- *
122
- * echo \Doctrine\Common\Inflector\Inflector::ucwords($string, '-_ ');
123
- * // Top-O-The-Morning To All_Of_You!
124
- * ?>
125
- * </code>
126
- *
127
- * @param string $string The string to operate on.
128
- * @param string $delimiters A list of word separators.
129
- *
130
- * @return string The string with all delimiter-separated words capitalized.
131
- *
132
- * @deprecated
133
- */
134
- public static function ucwords(string $string, string $delimiters = " \n\t\r\0\x0B-") : string
135
- {
136
- @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please use the "ucwords" function instead.', __METHOD__), E_USER_DEPRECATED);
137
-
138
- return ucwords($string, $delimiters);
139
- }
140
-
141
- /**
142
- * Clears Inflectors inflected value caches, and resets the inflection
143
- * rules to the initial values.
144
- *
145
- * @deprecated
146
- */
147
- public static function reset() : void
148
- {
149
- @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
150
-
151
- self::$factory = null;
152
- self::$instance = null;
153
- }
154
-
155
- /**
156
- * Adds custom inflection $rules, of either 'plural' or 'singular' $type.
157
- *
158
- * ### Usage:
159
- *
160
- * {{{
161
- * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables'));
162
- * Inflector::rules('plural', array(
163
- * 'rules' => array('/^(inflect)ors$/i' => '\1ables'),
164
- * 'uninflected' => array('dontinflectme'),
165
- * 'irregular' => array('red' => 'redlings')
166
- * ));
167
- * }}}
168
- *
169
- * @param string $type The type of inflection, either 'plural' or 'singular'
170
- * @param array|iterable $rules An array of rules to be added.
171
- * @param boolean $reset If true, will unset default inflections for all
172
- * new rules that are being defined in $rules.
173
- *
174
- * @return void
175
- *
176
- * @deprecated
177
- */
178
- public static function rules(string $type, iterable $rules, bool $reset = false) : void
179
- {
180
- @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
181
-
182
- if (self::$factory === null) {
183
- self::$factory = self::createFactory();
184
- }
185
-
186
- self::$instance = null;
187
-
188
- switch ($type) {
189
- case 'singular':
190
- self::$factory->withSingularRules(self::buildRuleset($rules), $reset);
191
- break;
192
- case 'plural':
193
- self::$factory->withPluralRules(self::buildRuleset($rules), $reset);
194
- break;
195
- default:
196
- throw new InvalidArgumentException(sprintf('Cannot define custom inflection rules for type "%s".', $type));
197
- }
198
- }
199
-
200
- private static function buildRuleset(iterable $rules) : Ruleset
201
- {
202
- $regular = [];
203
- $irregular = [];
204
- $uninflected = [];
205
-
206
- foreach ($rules as $rule => $pattern) {
207
- if ( ! is_array($pattern)) {
208
- $regular[$rule] = $pattern;
209
-
210
- continue;
211
- }
212
-
213
- switch ($rule) {
214
- case 'uninflected':
215
- $uninflected = $pattern;
216
- break;
217
- case 'irregular':
218
- $irregular = $pattern;
219
- break;
220
- case 'rules':
221
- $regular = $pattern;
222
- break;
223
- }
224
- }
225
-
226
- return new Ruleset(
227
- new Transformations(...array_map(
228
- static function (string $pattern, string $replacement) : Transformation {
229
- return new Transformation(new Pattern($pattern), $replacement);
230
- },
231
- array_keys($regular),
232
- array_values($regular)
233
- )),
234
- new Patterns(...array_map(
235
- static function (string $pattern) : Pattern {
236
- return new Pattern($pattern);
237
- },
238
- $uninflected
239
- )),
240
- new Substitutions(...array_map(
241
- static function (string $word, string $to) : Substitution {
242
- return new Substitution(new Word($word), new Word($to));
243
- },
244
- array_keys($irregular),
245
- array_values($irregular)
246
- ))
247
- );
248
- }
249
-
250
- /**
251
- * Returns a word in plural form.
252
- *
253
- * @param string $word The word in singular form.
254
- *
255
- * @return string The word in plural form.
256
- *
257
- * @deprecated
258
- */
259
- public static function pluralize(string $word) : string
260
- {
261
- @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
262
-
263
- return self::getInstance()->pluralize($word);
264
- }
265
-
266
- /**
267
- * Returns a word in singular form.
268
- *
269
- * @param string $word The word in plural form.
270
- *
271
- * @return string The word in singular form.
272
- *
273
- * @deprecated
274
- */
275
- public static function singularize(string $word) : string
276
- {
277
- @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED);
278
-
279
- return self::getInstance()->singularize($word);
280
- }
281
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/illuminate/{support → collections}/Arr.php RENAMED
@@ -3,8 +3,8 @@
3
  namespace Illuminate\Support;
4
 
5
  use ArrayAccess;
6
- use InvalidArgumentException;
7
  use Illuminate\Support\Traits\Macroable;
 
8
 
9
  class Arr
10
  {
@@ -24,9 +24,9 @@ class Arr
24
  /**
25
  * Add an element to an array using "dot" notation if it doesn't exist.
26
  *
27
- * @param array $array
28
  * @param string $key
29
- * @param mixed $value
30
  * @return array
31
  */
32
  public static function add($array, $key, $value)
@@ -41,7 +41,7 @@ class Arr
41
  /**
42
  * Collapse an array of arrays into a single array.
43
  *
44
- * @param array $array
45
  * @return array
46
  */
47
  public static function collapse($array)
@@ -55,16 +55,16 @@ class Arr
55
  continue;
56
  }
57
 
58
- $results = array_merge($results, $values);
59
  }
60
 
61
- return $results;
62
  }
63
 
64
  /**
65
  * Cross join the given arrays, returning all possible permutations.
66
  *
67
- * @param array ...$arrays
68
  * @return array
69
  */
70
  public static function crossJoin(...$arrays)
@@ -102,7 +102,7 @@ class Arr
102
  /**
103
  * Flatten a multi-dimensional associative array with dots.
104
  *
105
- * @param array $array
106
  * @param string $prepend
107
  * @return array
108
  */
@@ -122,7 +122,7 @@ class Arr
122
  }
123
 
124
  /**
125
- * Get all of the given array except for a specified array of items.
126
  *
127
  * @param array $array
128
  * @param array|string $keys
@@ -144,6 +144,10 @@ class Arr
144
  */
145
  public static function exists($array, $key)
146
  {
 
 
 
 
147
  if ($array instanceof ArrayAccess) {
148
  return $array->offsetExists($key);
149
  }
@@ -154,7 +158,7 @@ class Arr
154
  /**
155
  * Return the first element in an array passing a given truth test.
156
  *
157
- * @param array $array
158
  * @param callable|null $callback
159
  * @param mixed $default
160
  * @return mixed
@@ -172,7 +176,7 @@ class Arr
172
  }
173
 
174
  foreach ($array as $key => $value) {
175
- if (call_user_func($callback, $value, $key)) {
176
  return $value;
177
  }
178
  }
@@ -200,23 +204,31 @@ class Arr
200
  /**
201
  * Flatten a multi-dimensional array into a single level.
202
  *
203
- * @param array $array
204
  * @param int $depth
205
  * @return array
206
  */
207
  public static function flatten($array, $depth = INF)
208
  {
209
- return array_reduce($array, function ($result, $item) use ($depth) {
 
 
210
  $item = $item instanceof Collection ? $item->all() : $item;
211
 
212
  if (! is_array($item)) {
213
- return array_merge($result, [$item]);
214
- } elseif ($depth === 1) {
215
- return array_merge($result, array_values($item));
216
  } else {
217
- return array_merge($result, static::flatten($item, $depth - 1));
 
 
 
 
 
 
218
  }
219
- }, []);
 
 
220
  }
221
 
222
  /**
@@ -267,8 +279,8 @@ class Arr
267
  * Get an item from an array using "dot" notation.
268
  *
269
  * @param \ArrayAccess|array $array
270
- * @param string $key
271
- * @param mixed $default
272
  * @return mixed
273
  */
274
  public static function get($array, $key, $default = null)
@@ -285,6 +297,10 @@ class Arr
285
  return $array[$key];
286
  }
287
 
 
 
 
 
288
  foreach (explode('.', $key) as $segment) {
289
  if (static::accessible($array) && static::exists($array, $segment)) {
290
  $array = $array[$segment];
@@ -305,17 +321,9 @@ class Arr
305
  */
306
  public static function has($array, $keys)
307
  {
308
- if (is_null($keys)) {
309
- return false;
310
- }
311
-
312
  $keys = (array) $keys;
313
 
314
- if (! $array) {
315
- return false;
316
- }
317
-
318
- if ($keys === []) {
319
  return false;
320
  }
321
 
@@ -338,6 +346,38 @@ class Arr
338
  return true;
339
  }
340
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
  /**
342
  * Determines if an array is associative.
343
  *
@@ -368,8 +408,8 @@ class Arr
368
  /**
369
  * Pluck an array of values from an array.
370
  *
371
- * @param array $array
372
- * @param string|array $value
373
  * @param string|array|null $key
374
  * @return array
375
  */
@@ -377,7 +417,7 @@ class Arr
377
  {
378
  $results = [];
379
 
380
- list($value, $key) = static::explodePluckParameters($value, $key);
381
 
382
  foreach ($array as $item) {
383
  $itemValue = data_get($item, $value);
@@ -427,7 +467,7 @@ class Arr
427
  */
428
  public static function prepend($array, $value, $key = null)
429
  {
430
- if (is_null($key)) {
431
  array_unshift($array, $value);
432
  } else {
433
  $array = [$key => $value] + $array;
@@ -439,9 +479,9 @@ class Arr
439
  /**
440
  * Get a value from the array, and remove it.
441
  *
442
- * @param array $array
443
  * @param string $key
444
- * @param mixed $default
445
  * @return mixed
446
  */
447
  public static function pull(&$array, $key, $default = null)
@@ -458,11 +498,12 @@ class Arr
458
  *
459
  * @param array $array
460
  * @param int|null $number
 
461
  * @return mixed
462
  *
463
  * @throws \InvalidArgumentException
464
  */
465
- public static function random($array, $number = null)
466
  {
467
  $requested = is_null($number) ? 1 : $number;
468
 
@@ -486,8 +527,14 @@ class Arr
486
 
487
  $results = [];
488
 
489
- foreach ((array) $keys as $key) {
490
- $results[] = $array[$key];
 
 
 
 
 
 
491
  }
492
 
493
  return $results;
@@ -498,9 +545,9 @@ class Arr
498
  *
499
  * If no key is given to the method, the entire array will be replaced.
500
  *
501
- * @param array $array
502
- * @param string $key
503
- * @param mixed $value
504
  * @return array
505
  */
506
  public static function set(&$array, $key, $value)
@@ -511,8 +558,12 @@ class Arr
511
 
512
  $keys = explode('.', $key);
513
 
514
- while (count($keys) > 1) {
515
- $key = array_shift($keys);
 
 
 
 
516
 
517
  // If the key doesn't exist at this depth, we will just create an empty array
518
  // to hold the next value, allowing us to create the arrays to hold final
@@ -533,11 +584,18 @@ class Arr
533
  * Shuffle the given array and return the result.
534
  *
535
  * @param array $array
 
536
  * @return array
537
  */
538
- public static function shuffle($array)
539
  {
540
- shuffle($array);
 
 
 
 
 
 
541
 
542
  return $array;
543
  }
@@ -546,10 +604,10 @@ class Arr
546
  * Sort the array using the given callback or "dot" notation.
547
  *
548
  * @param array $array
549
- * @param callable|string $callback
550
  * @return array
551
  */
552
- public static function sort($array, $callback)
553
  {
554
  return Collection::make($array)->sortBy($callback)->all();
555
  }
@@ -558,25 +616,42 @@ class Arr
558
  * Recursively sort an array by keys and values.
559
  *
560
  * @param array $array
 
 
561
  * @return array
562
  */
563
- public static function sortRecursive($array)
564
  {
565
  foreach ($array as &$value) {
566
  if (is_array($value)) {
567
- $value = static::sortRecursive($value);
568
  }
569
  }
570
 
571
  if (static::isAssoc($array)) {
572
- ksort($array);
 
 
573
  } else {
574
- sort($array);
 
 
575
  }
576
 
577
  return $array;
578
  }
579
 
 
 
 
 
 
 
 
 
 
 
 
580
  /**
581
  * Filter the array using the given callback.
582
  *
@@ -590,13 +665,17 @@ class Arr
590
  }
591
 
592
  /**
593
- * If the given value is not an array, wrap it in one.
594
  *
595
  * @param mixed $value
596
  * @return array
597
  */
598
  public static function wrap($value)
599
  {
600
- return ! is_array($value) ? [$value] : $value;
 
 
 
 
601
  }
602
  }
3
  namespace Illuminate\Support;
4
 
5
  use ArrayAccess;
 
6
  use Illuminate\Support\Traits\Macroable;
7
+ use InvalidArgumentException;
8
 
9
  class Arr
10
  {
24
  /**
25
  * Add an element to an array using "dot" notation if it doesn't exist.
26
  *
27
+ * @param array $array
28
  * @param string $key
29
+ * @param mixed $value
30
  * @return array
31
  */
32
  public static function add($array, $key, $value)
41
  /**
42
  * Collapse an array of arrays into a single array.
43
  *
44
+ * @param iterable $array
45
  * @return array
46
  */
47
  public static function collapse($array)
55
  continue;
56
  }
57
 
58
+ $results[] = $values;
59
  }
60
 
61
+ return array_merge([], ...$results);
62
  }
63
 
64
  /**
65
  * Cross join the given arrays, returning all possible permutations.
66
  *
67
+ * @param iterable ...$arrays
68
  * @return array
69
  */
70
  public static function crossJoin(...$arrays)
102
  /**
103
  * Flatten a multi-dimensional associative array with dots.
104
  *
105
+ * @param iterable $array
106
  * @param string $prepend
107
  * @return array
108
  */
122
  }
123
 
124
  /**
125
+ * Get all of the given array except for a specified array of keys.
126
  *
127
  * @param array $array
128
  * @param array|string $keys
144
  */
145
  public static function exists($array, $key)
146
  {
147
+ if ($array instanceof Enumerable) {
148
+ return $array->has($key);
149
+ }
150
+
151
  if ($array instanceof ArrayAccess) {
152
  return $array->offsetExists($key);
153
  }
158
  /**
159
  * Return the first element in an array passing a given truth test.
160
  *
161
+ * @param iterable $array
162
  * @param callable|null $callback
163
  * @param mixed $default
164
  * @return mixed
176
  }
177
 
178
  foreach ($array as $key => $value) {
179
+ if ($callback($value, $key)) {
180
  return $value;
181
  }
182
  }
204
  /**
205
  * Flatten a multi-dimensional array into a single level.
206
  *
207
+ * @param iterable $array
208
  * @param int $depth
209
  * @return array
210
  */
211
  public static function flatten($array, $depth = INF)
212
  {
213
+ $result = [];
214
+
215
+ foreach ($array as $item) {
216
  $item = $item instanceof Collection ? $item->all() : $item;
217
 
218
  if (! is_array($item)) {
219
+ $result[] = $item;
 
 
220
  } else {
221
+ $values = $depth === 1
222
+ ? array_values($item)
223
+ : static::flatten($item, $depth - 1);
224
+
225
+ foreach ($values as $value) {
226
+ $result[] = $value;
227
+ }
228
  }
229
+ }
230
+
231
+ return $result;
232
  }
233
 
234
  /**
279
  * Get an item from an array using "dot" notation.
280
  *
281
  * @param \ArrayAccess|array $array
282
+ * @param string|int|null $key
283
+ * @param mixed $default
284
  * @return mixed
285
  */
286
  public static function get($array, $key, $default = null)
297
  return $array[$key];
298
  }
299
 
300
+ if (strpos($key, '.') === false) {
301
+ return $array[$key] ?? value($default);
302
+ }
303
+
304
  foreach (explode('.', $key) as $segment) {
305
  if (static::accessible($array) && static::exists($array, $segment)) {
306
  $array = $array[$segment];
321
  */
322
  public static function has($array, $keys)
323
  {
 
 
 
 
324
  $keys = (array) $keys;
325
 
326
+ if (! $array || $keys === []) {
 
 
 
 
327
  return false;
328
  }
329
 
346
  return true;
347
  }
348
 
349
+ /**
350
+ * Determine if any of the keys exist in an array using "dot" notation.
351
+ *
352
+ * @param \ArrayAccess|array $array
353
+ * @param string|array $keys
354
+ * @return bool
355
+ */
356
+ public static function hasAny($array, $keys)
357
+ {
358
+ if (is_null($keys)) {
359
+ return false;
360
+ }
361
+
362
+ $keys = (array) $keys;
363
+
364
+ if (! $array) {
365
+ return false;
366
+ }
367
+
368
+ if ($keys === []) {
369
+ return false;
370
+ }
371
+
372
+ foreach ($keys as $key) {
373
+ if (static::has($array, $key)) {
374
+ return true;
375
+ }
376
+ }
377
+
378
+ return false;
379
+ }
380
+
381
  /**
382
  * Determines if an array is associative.
383
  *
408
  /**
409
  * Pluck an array of values from an array.
410
  *
411
+ * @param iterable $array
412
+ * @param string|array|int|null $value
413
  * @param string|array|null $key
414
  * @return array
415
  */
417
  {
418
  $results = [];
419
 
420
+ [$value, $key] = static::explodePluckParameters($value, $key);
421
 
422
  foreach ($array as $item) {
423
  $itemValue = data_get($item, $value);
467
  */
468
  public static function prepend($array, $value, $key = null)
469
  {
470
+ if (func_num_args() == 2) {
471
  array_unshift($array, $value);
472
  } else {
473
  $array = [$key => $value] + $array;
479
  /**
480
  * Get a value from the array, and remove it.
481
  *
482
+ * @param array $array
483
  * @param string $key
484
+ * @param mixed $default
485
  * @return mixed
486
  */
487
  public static function pull(&$array, $key, $default = null)
498
  *
499
  * @param array $array
500
  * @param int|null $number
501
+ * @param bool|false $preserveKeys
502
  * @return mixed
503
  *
504
  * @throws \InvalidArgumentException
505
  */
506
+ public static function random($array, $number = null, $preserveKeys = false)
507
  {
508
  $requested = is_null($number) ? 1 : $number;
509
 
527
 
528
  $results = [];
529
 
530
+ if ($preserveKeys) {
531
+ foreach ((array) $keys as $key) {
532
+ $results[$key] = $array[$key];
533
+ }
534
+ } else {
535
+ foreach ((array) $keys as $key) {
536
+ $results[] = $array[$key];
537
+ }
538
  }
539
 
540
  return $results;
545
  *
546
  * If no key is given to the method, the entire array will be replaced.
547
  *
548
+ * @param array $array
549
+ * @param string|null $key
550
+ * @param mixed $value
551
  * @return array
552
  */
553
  public static function set(&$array, $key, $value)
558
 
559
  $keys = explode('.', $key);
560
 
561
+ foreach ($keys as $i => $key) {
562
+ if (count($keys) === 1) {
563
+ break;
564
+ }
565
+
566
+ unset($keys[$i]);
567
 
568
  // If the key doesn't exist at this depth, we will just create an empty array
569
  // to hold the next value, allowing us to create the arrays to hold final
584
  * Shuffle the given array and return the result.
585
  *
586
  * @param array $array
587
+ * @param int|null $seed
588
  * @return array
589
  */
590
+ public static function shuffle($array, $seed = null)
591
  {
592
+ if (is_null($seed)) {
593
+ shuffle($array);
594
+ } else {
595
+ mt_srand($seed);
596
+ shuffle($array);
597
+ mt_srand();
598
+ }
599
 
600
  return $array;
601
  }
604
  * Sort the array using the given callback or "dot" notation.
605
  *
606
  * @param array $array
607
+ * @param callable|array|string|null $callback
608
  * @return array
609
  */
610
+ public static function sort($array, $callback = null)
611
  {
612
  return Collection::make($array)->sortBy($callback)->all();
613
  }
616
  * Recursively sort an array by keys and values.
617
  *
618
  * @param array $array
619
+ * @param int $options
620
+ * @param bool $descending
621
  * @return array
622
  */
623
+ public static function sortRecursive($array, $options = SORT_REGULAR, $descending = false)
624
  {
625
  foreach ($array as &$value) {
626
  if (is_array($value)) {
627
+ $value = static::sortRecursive($value, $options, $descending);
628
  }
629
  }
630
 
631
  if (static::isAssoc($array)) {
632
+ $descending
633
+ ? krsort($array, $options)
634
+ : ksort($array, $options);
635
  } else {
636
+ $descending
637
+ ? rsort($array, $options)
638
+ : sort($array, $options);
639
  }
640
 
641
  return $array;
642
  }
643
 
644
+ /**
645
+ * Convert the array into a query string.
646
+ *
647
+ * @param array $array
648
+ * @return string
649
+ */
650
+ public static function query($array)
651
+ {
652
+ return http_build_query($array, '', '&', PHP_QUERY_RFC3986);
653
+ }
654
+
655
  /**
656
  * Filter the array using the given callback.
657
  *
665
  }
666
 
667
  /**
668
+ * If the given value is not an array and not null, wrap it in one.
669
  *
670
  * @param mixed $value
671
  * @return array
672
  */
673
  public static function wrap($value)
674
  {
675
+ if (is_null($value)) {
676
+ return [];
677
+ }
678
+
679
+ return is_array($value) ? $value : [$value];
680
  }
681
  }
vendor/illuminate/{support → collections}/Collection.php RENAMED
@@ -2,21 +2,15 @@
2
 
3
  namespace Illuminate\Support;
4
 
5
- use Countable;
6
- use Exception;
7
  use ArrayAccess;
8
- use Traversable;
9
  use ArrayIterator;
10
- use CachingIterator;
11
- use JsonSerializable;
12
- use IteratorAggregate;
13
  use Illuminate\Support\Traits\Macroable;
14
- use Illuminate\Contracts\Support\Jsonable;
15
- use Illuminate\Contracts\Support\Arrayable;
16
 
17
- class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable
18
  {
19
- use Macroable;
20
 
21
  /**
22
  * The items contained in the collection.
@@ -25,16 +19,6 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
25
  */
26
  protected $items = [];
27
 
28
- /**
29
- * The methods that can be proxied.
30
- *
31
- * @var array
32
- */
33
- protected static $proxies = [
34
- 'average', 'avg', 'contains', 'each', 'every', 'filter', 'first', 'flatMap',
35
- 'map', 'partition', 'reject', 'sortBy', 'sortByDesc', 'sum',
36
- ];
37
-
38
  /**
39
  * Create a new collection.
40
  *
@@ -47,34 +31,15 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
47
  }
48
 
49
  /**
50
- * Create a new collection instance if the value isn't one already.
51
- *
52
- * @param mixed $items
53
- * @return static
54
- */
55
- public static function make($items = [])
56
- {
57
- return new static($items);
58
- }
59
-
60
- /**
61
- * Create a new collection by invoking the callback a given number of times.
62
  *
63
- * @param int $number
64
- * @param callable $callback
65
  * @return static
66
  */
67
- public static function times($number, callable $callback = null)
68
  {
69
- if ($number < 1) {
70
- return new static;
71
- }
72
-
73
- if (is_null($callback)) {
74
- return new static(range(1, $number));
75
- }
76
-
77
- return (new static(range(1, $number)))->map($callback);
78
  }
79
 
80
  /**
@@ -88,46 +53,55 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
88
  }
89
 
90
  /**
91
- * Get the average value of a given key.
92
  *
93
- * @param callable|string|null $callback
94
- * @return mixed
95
  */
96
- public function avg($callback = null)
97
  {
98
- if ($count = $this->count()) {
99
- return $this->sum($callback) / $count;
100
- }
101
  }
102
 
103
  /**
104
- * Alias for the "avg" method.
105
  *
106
  * @param callable|string|null $callback
107
  * @return mixed
108
  */
109
- public function average($callback = null)
110
  {
111
- return $this->avg($callback);
 
 
 
 
 
 
 
 
 
 
112
  }
113
 
114
  /**
115
  * Get the median of a given key.
116
  *
117
- * @param null $key
118
  * @return mixed
119
  */
120
  public function median($key = null)
121
  {
122
- $count = $this->count();
 
 
 
123
 
124
- if ($count == 0) {
 
 
125
  return;
126
  }
127
 
128
- $values = with(isset($key) ? $this->pluck($key) : $this)
129
- ->sort()->values();
130
-
131
  $middle = (int) ($count / 2);
132
 
133
  if ($count % 2) {
@@ -142,20 +116,18 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
142
  /**
143
  * Get the mode of a given key.
144
  *
145
- * @param mixed $key
146
  * @return array|null
147
  */
148
  public function mode($key = null)
149
  {
150
- $count = $this->count();
151
-
152
- if ($count == 0) {
153
  return;
154
  }
155
 
156
  $collection = isset($key) ? $this->pluck($key) : $this;
157
 
158
- $counts = new self;
159
 
160
  $collection->each(function ($value) use ($counts) {
161
  $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1;
@@ -190,43 +162,17 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
190
  */
191
  public function contains($key, $operator = null, $value = null)
192
  {
193
- if (func_num_args() == 1) {
194
  if ($this->useAsCallable($key)) {
195
- return ! is_null($this->first($key));
 
 
196
  }
197
 
198
  return in_array($key, $this->items);
199
  }
200
 
201
- if (func_num_args() == 2) {
202
- $value = $operator;
203
-
204
- $operator = '=';
205
- }
206
-
207
- return $this->contains($this->operatorForWhere($key, $operator, $value));
208
- }
209
-
210
- /**
211
- * Determine if an item exists in the collection using strict comparison.
212
- *
213
- * @param mixed $key
214
- * @param mixed $value
215
- * @return bool
216
- */
217
- public function containsStrict($key, $value = null)
218
- {
219
- if (func_num_args() == 2) {
220
- return $this->contains(function ($item) use ($key, $value) {
221
- return data_get($item, $key) === $value;
222
- });
223
- }
224
-
225
- if ($this->useAsCallable($key)) {
226
- return ! is_null($this->first($key));
227
- }
228
-
229
- return in_array($key, $this->items, true);
230
  }
231
 
232
  /**
@@ -254,268 +200,155 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
254
  }
255
 
256
  /**
257
- * Get the items in the collection whose keys and values are not present in the given items.
258
  *
259
  * @param mixed $items
 
260
  * @return static
261
  */
262
- public function diffAssoc($items)
263
  {
264
- return new static(array_diff_assoc($this->items, $this->getArrayableItems($items)));
265
  }
266
 
267
  /**
268
- * Get the items in the collection whose keys are not present in the given items.
269
  *
270
  * @param mixed $items
271
  * @return static
272
  */
273
- public function diffKeys($items)
274
- {
275
- return new static(array_diff_key($this->items, $this->getArrayableItems($items)));
276
- }
277
-
278
- /**
279
- * Execute a callback over each item.
280
- *
281
- * @param callable $callback
282
- * @return $this
283
- */
284
- public function each(callable $callback)
285
  {
286
- foreach ($this->items as $key => $item) {
287
- if ($callback($item, $key) === false) {
288
- break;
289
- }
290
- }
291
-
292
- return $this;
293
  }
294
 
295
  /**
296
- * Execute a callback over each nested chunk of items.
297
  *
 
298
  * @param callable $callback
299
  * @return static
300
  */
301
- public function eachSpread(callable $callback)
302
  {
303
- return $this->each(function ($chunk) use ($callback) {
304
- return $callback(...$chunk);
305
- });
306
  }
307
 
308
  /**
309
- * Determine if all items in the collection pass the given test.
310
  *
311
- * @param string|callable $key
312
- * @param mixed $operator
313
- * @param mixed $value
314
- * @return bool
315
  */
316
- public function every($key, $operator = null, $value = null)
317
  {
318
- if (func_num_args() == 1) {
319
- $callback = $this->valueRetriever($key);
320
-
321
- foreach ($this->items as $k => $v) {
322
- if (! $callback($v, $k)) {
323
- return false;
324
- }
325
- }
326
-
327
- return true;
328
- }
329
-
330
- if (func_num_args() == 2) {
331
- $value = $operator;
332
-
333
- $operator = '=';
334
- }
335
-
336
- return $this->every($this->operatorForWhere($key, $operator, $value));
337
  }
338
 
339
  /**
340
- * Get all items except for those with the specified keys.
341
  *
342
- * @param mixed $keys
 
343
  * @return static
344
  */
345
- public function except($keys)
346
  {
347
- $keys = is_array($keys) ? $keys : func_get_args();
348
-
349
- return new static(Arr::except($this->items, $keys));
350
  }
351
 
352
  /**
353
- * Run a filter over each of the items.
354
  *
355
  * @param callable|null $callback
 
356
  * @return static
357
  */
358
- public function filter(callable $callback = null)
359
- {
360
- if ($callback) {
361
- return new static(Arr::where($this->items, $callback));
362
- }
363
-
364
- return new static(array_filter($this->items));
365
- }
366
-
367
- /**
368
- * Apply the callback if the value is truthy.
369
- *
370
- * @param bool $value
371
- * @param callable $callback
372
- * @param callable $default
373
- * @return mixed
374
- */
375
- public function when($value, callable $callback, callable $default = null)
376
  {
377
- if ($value) {
378
- return $callback($this);
379
- } elseif ($default) {
380
- return $default($this);
381
- }
382
 
383
- return $this;
384
- }
385
 
386
- /**
387
- * Apply the callback if the value is falsy.
388
- *
389
- * @param bool $value
390
- * @param callable $callback
391
- * @param callable $default
392
- * @return mixed
393
- */
394
- public function unless($value, callable $callback, callable $default = null)
395
- {
396
- return $this->when(! $value, $callback, $default);
397
- }
398
 
399
- /**
400
- * Filter items by the given key value pair.
401
- *
402
- * @param string $key
403
- * @param mixed $operator
404
- * @param mixed $value
405
- * @return static
406
- */
407
- public function where($key, $operator, $value = null)
408
- {
409
- if (func_num_args() == 2) {
410
- $value = $operator;
411
 
412
- $operator = '=';
 
 
 
 
 
413
  }
414
 
415
- return $this->filter($this->operatorForWhere($key, $operator, $value));
416
- }
417
-
418
- /**
419
- * Get an operator checker callback.
420
- *
421
- * @param string $key
422
- * @param string $operator
423
- * @param mixed $value
424
- * @return \Closure
425
- */
426
- protected function operatorForWhere($key, $operator, $value)
427
- {
428
- return function ($item) use ($key, $operator, $value) {
429
- $retrieved = data_get($item, $key);
430
-
431
- switch ($operator) {
432
- default:
433
- case '=':
434
- case '==': return $retrieved == $value;
435
- case '!=':
436
- case '<>': return $retrieved != $value;
437
- case '<': return $retrieved < $value;
438
- case '>': return $retrieved > $value;
439
- case '<=': return $retrieved <= $value;
440
- case '>=': return $retrieved >= $value;
441
- case '===': return $retrieved === $value;
442
- case '!==': return $retrieved !== $value;
443
- }
444
- };
445
  }
446
 
447
  /**
448
- * Filter items by the given key value pair using strict comparison.
449
  *
450
- * @param string $key
451
- * @param mixed $value
452
  * @return static
453
  */
454
- public function whereStrict($key, $value)
455
  {
456
- return $this->where($key, '===', $value);
457
  }
458
 
459
  /**
460
- * Filter items by the given key value pair.
461
  *
462
- * @param string $key
463
- * @param mixed $values
464
  * @param bool $strict
465
- * @return static
466
  */
467
- public function whereIn($key, $values, $strict = false)
468
  {
469
- $values = $this->getArrayableItems($values);
470
-
471
- return $this->filter(function ($item) use ($key, $values, $strict) {
472
- return in_array(data_get($item, $key), $values, $strict);
473
- });
474
- }
475
 
476
- /**
477
- * Filter items by the given key value pair using strict comparison.
478
- *
479
- * @param string $key
480
- * @param mixed $values
481
- * @return static
482
- */
483
- public function whereInStrict($key, $values)
484
- {
485
- return $this->whereIn($key, $values, true);
486
  }
487
 
488
  /**
489
- * Filter items by the given key value pair.
490
  *
491
- * @param string $key
492
- * @param mixed $values
493
- * @param bool $strict
494
  * @return static
495
  */
496
- public function whereNotIn($key, $values, $strict = false)
497
  {
498
- $values = $this->getArrayableItems($values);
 
 
 
 
499
 
500
- return $this->reject(function ($item) use ($key, $values, $strict) {
501
- return in_array(data_get($item, $key), $values, $strict);
502
- });
503
  }
504
 
505
  /**
506
- * Filter items by the given key value pair using strict comparison.
507
  *
508
- * @param string $key
509
- * @param mixed $values
510
  * @return static
511
  */
512
- public function whereNotInStrict($key, $values)
513
  {
514
- return $this->whereNotIn($key, $values, true);
 
 
 
 
515
  }
516
 
517
  /**
518
- * Get the first item from the collection.
519
  *
520
  * @param callable|null $callback
521
  * @param mixed $default
@@ -571,7 +404,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
571
  */
572
  public function get($key, $default = null)
573
  {
574
- if ($this->offsetExists($key)) {
575
  return $this->items[$key];
576
  }
577
 
@@ -581,12 +414,18 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
581
  /**
582
  * Group an associative array by a field or using a callback.
583
  *
584
- * @param callable|string $groupBy
585
  * @param bool $preserveKeys
586
  * @return static
587
  */
588
  public function groupBy($groupBy, $preserveKeys = false)
589
  {
 
 
 
 
 
 
590
  $groupBy = $this->valueRetriever($groupBy);
591
 
592
  $results = [];
@@ -609,7 +448,13 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
609
  }
610
  }
611
 
612
- return new static($results);
 
 
 
 
 
 
613
  }
614
 
615
  /**
@@ -645,21 +490,29 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
645
  */
646
  public function has($key)
647
  {
648
- return $this->offsetExists($key);
 
 
 
 
 
 
 
 
649
  }
650
 
651
  /**
652
  * Concatenate values of a given key as a string.
653
  *
654
  * @param string $value
655
- * @param string $glue
656
  * @return string
657
  */
658
  public function implode($value, $glue = null)
659
  {
660
  $first = $this->first();
661
 
662
- if (is_array($first) || is_object($first)) {
663
  return implode($glue, $this->pluck($value)->all());
664
  }
665
 
@@ -683,9 +536,11 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
683
  * @param mixed $items
684
  * @return static
685
  */
686
- public function intersectKey($items)
687
  {
688
- return new static(array_intersect_key($this->items, $this->getArrayableItems($items)));
 
 
689
  }
690
 
691
  /**
@@ -699,24 +554,43 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
699
  }
700
 
701
  /**
702
- * Determine if the collection is not empty.
703
  *
704
  * @return bool
705
  */
706
- public function isNotEmpty()
707
  {
708
- return ! $this->isEmpty();
709
  }
710
 
711
  /**
712
- * Determine if the given value is callable, but not a string.
713
  *
714
- * @param mixed $value
715
- * @return bool
 
716
  */
717
- protected function useAsCallable($value)
718
  {
719
- return ! is_string($value) && is_callable($value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  }
721
 
722
  /**
@@ -744,7 +618,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
744
  /**
745
  * Get the values of a given key.
746
  *
747
- * @param string|array $value
748
  * @param string|null $key
749
  * @return static
750
  */
@@ -769,35 +643,32 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
769
  }
770
 
771
  /**
772
- * Run a map over each nested chunk of items.
773
- *
774
- * @param callable $callback
775
- * @return static
776
- */
777
- public function mapSpread(callable $callback)
778
- {
779
- return $this->map(function ($chunk) use ($callback) {
780
- return $callback(...$chunk);
781
- });
782
- }
783
-
784
- /**
785
- * Run a grouping map over the items.
786
  *
787
  * The callback should return an associative array with a single key/value pair.
788
  *
789
  * @param callable $callback
790
  * @return static
791
  */
792
- public function mapToGroups(callable $callback)
793
  {
794
- $groups = $this->map($callback)->reduce(function ($groups, $pair) {
795
- $groups[key($pair)][] = reset($pair);
 
 
 
 
 
 
 
 
 
 
796
 
797
- return $groups;
798
- }, []);
799
 
800
- return (new static($groups))->map([$this, 'make']);
801
  }
802
 
803
  /**
@@ -824,44 +695,25 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
824
  }
825
 
826
  /**
827
- * Map a collection and flatten the result by a single level.
828
  *
829
- * @param callable $callback
830
  * @return static
831
  */
832
- public function flatMap(callable $callback)
833
- {
834
- return $this->map($callback)->collapse();
835
- }
836
-
837
- /**
838
- * Get the max value of a given key.
839
- *
840
- * @param callable|string|null $callback
841
- * @return mixed
842
- */
843
- public function max($callback = null)
844
  {
845
- $callback = $this->valueRetriever($callback);
846
-
847
- return $this->filter(function ($value) {
848
- return ! is_null($value);
849
- })->reduce(function ($result, $item) use ($callback) {
850
- $value = $callback($item);
851
-
852
- return is_null($result) || $value > $result ? $value : $result;
853
- });
854
  }
855
 
856
  /**
857
- * Merge the collection with the given items.
858
  *
859
  * @param mixed $items
860
  * @return static
861
  */
862
- public function merge($items)
863
  {
864
- return new static(array_merge($this->items, $this->getArrayableItems($items)));
865
  }
866
 
867
  /**
@@ -887,26 +739,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
887
  }
888
 
889
  /**
890
- * Get the min value of a given key.
891
- *
892
- * @param callable|string|null $callback
893
- * @return mixed
894
- */
895
- public function min($callback = null)
896
- {
897
- $callback = $this->valueRetriever($callback);
898
-
899
- return $this->filter(function ($value) {
900
- return ! is_null($value);
901
- })->reduce(function ($result, $item) use ($callback) {
902
- $value = $callback($item);
903
-
904
- return is_null($result) || $value < $result ? $value : $result;
905
- });
906
- }
907
-
908
- /**
909
- * Create a new collection consisting of every n-th element.
910
  *
911
  * @param int $step
912
  * @param int $offset
@@ -941,51 +774,13 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
941
  return new static($this->items);
942
  }
943
 
944
- $keys = is_array($keys) ? $keys : func_get_args();
945
-
946
- return new static(Arr::only($this->items, $keys));
947
- }
948
-
949
- /**
950
- * "Paginate" the collection by slicing it into a smaller collection.
951
- *
952
- * @param int $page
953
- * @param int $perPage
954
- * @return static
955
- */
956
- public function forPage($page, $perPage)
957
- {
958
- return $this->slice(($page - 1) * $perPage, $perPage);
959
- }
960
-
961
- /**
962
- * Partition the collection into two arrays using the given callback or key.
963
- *
964
- * @param callable|string $callback
965
- * @return static
966
- */
967
- public function partition($callback)
968
- {
969
- $partitions = [new static, new static];
970
-
971
- $callback = $this->valueRetriever($callback);
972
-
973
- foreach ($this->items as $key => $item) {
974
- $partitions[(int) ! $callback($item)][$key] = $item;
975
  }
976
 
977
- return new static($partitions);
978
- }
979
 
980
- /**
981
- * Pass the collection to the given callback and return the result.
982
- *
983
- * @param callable $callback
984
- * @return mixed
985
- */
986
- public function pipe(callable $callback)
987
- {
988
- return $callback($this);
989
  }
990
 
991
  /**
@@ -1007,20 +802,22 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1007
  */
1008
  public function prepend($value, $key = null)
1009
  {
1010
- $this->items = Arr::prepend($this->items, $value, $key);
1011
 
1012
  return $this;
1013
  }
1014
 
1015
  /**
1016
- * Push an item onto the end of the collection.
1017
  *
1018
- * @param mixed $value
1019
  * @return $this
1020
  */
1021
- public function push($value)
1022
  {
1023
- $this->offsetSet(null, $value);
 
 
1024
 
1025
  return $this;
1026
  }
@@ -1028,8 +825,8 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1028
  /**
1029
  * Push all of the given items onto the collection.
1030
  *
1031
- * @param \Traversable $source
1032
- * @return self
1033
  */
1034
  public function concat($source)
1035
  {
@@ -1072,7 +869,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1072
  * Get one or a specified number of items randomly from the collection.
1073
  *
1074
  * @param int|null $number
1075
- * @return mixed
1076
  *
1077
  * @throws \InvalidArgumentException
1078
  */
@@ -1086,34 +883,25 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1086
  }
1087
 
1088
  /**
1089
- * Reduce the collection to a single value.
1090
  *
1091
- * @param callable $callback
1092
- * @param mixed $initial
1093
- * @return mixed
1094
  */
1095
- public function reduce(callable $callback, $initial = null)
1096
  {
1097
- return array_reduce($this->items, $callback, $initial);
1098
  }
1099
 
1100
  /**
1101
- * Create a collection of all elements that do not pass a given truth test.
1102
  *
1103
- * @param callable|mixed $callback
1104
  * @return static
1105
  */
1106
- public function reject($callback)
1107
  {
1108
- if ($this->useAsCallable($callback)) {
1109
- return $this->filter(function ($value, $key) use ($callback) {
1110
- return ! $callback($value, $key);
1111
- });
1112
- }
1113
-
1114
- return $this->filter(function ($item) use ($callback) {
1115
- return $item != $callback;
1116
- });
1117
  }
1118
 
1119
  /**
@@ -1140,7 +928,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1140
  }
1141
 
1142
  foreach ($this->items as $key => $item) {
1143
- if (call_user_func($value, $item, $key)) {
1144
  return $key;
1145
  }
1146
  }
@@ -1161,31 +949,52 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1161
  /**
1162
  * Shuffle the items in the collection.
1163
  *
1164
- * @param int $seed
1165
  * @return static
1166
  */
1167
  public function shuffle($seed = null)
1168
  {
1169
- $items = $this->items;
 
1170
 
1171
- if (is_null($seed)) {
1172
- shuffle($items);
1173
- } else {
1174
- srand($seed);
 
 
 
 
 
 
1175
 
1176
- usort($items, function () {
1177
- return rand(-1, 1);
1178
- });
1179
- }
 
 
 
 
 
 
1180
 
1181
- return new static($items);
 
 
 
 
 
 
 
 
1182
  }
1183
 
1184
  /**
1185
  * Slice the underlying collection array.
1186
  *
1187
  * @param int $offset
1188
- * @param int $length
1189
  * @return static
1190
  */
1191
  public function slice($offset, $length = null)
@@ -1205,13 +1014,44 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1205
  return new static;
1206
  }
1207
 
1208
- $groupSize = ceil($this->count() / $numberOfGroups);
 
 
 
 
1209
 
1210
- return $this->chunk($groupSize);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1211
  }
1212
 
1213
  /**
1214
- * Chunk the underlying collection array.
 
 
 
 
 
 
 
 
 
 
 
1215
  *
1216
  * @param int $size
1217
  * @return static
@@ -1231,19 +1071,47 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1231
  return new static($chunks);
1232
  }
1233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1234
  /**
1235
  * Sort through each item with a callback.
1236
  *
1237
- * @param callable|null $callback
1238
  * @return static
1239
  */
1240
- public function sort(callable $callback = null)
1241
  {
1242
  $items = $this->items;
1243
 
1244
- $callback
1245
  ? uasort($items, $callback)
1246
- : asort($items);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1247
 
1248
  return new static($items);
1249
  }
@@ -1251,13 +1119,17 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1251
  /**
1252
  * Sort the collection using the given callback.
1253
  *
1254
- * @param callable|string $callback
1255
  * @param int $options
1256
  * @param bool $descending
1257
  * @return static
1258
  */
1259
  public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
1260
  {
 
 
 
 
1261
  $results = [];
1262
 
1263
  $callback = $this->valueRetriever($callback);
@@ -1270,7 +1142,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1270
  }
1271
 
1272
  $descending ? arsort($results, $options)
1273
- : asort($results, $options);
1274
 
1275
  // Once we have sorted all of the keys in the array, we will loop through them
1276
  // and grab the corresponding model so we can set the underlying items list
@@ -1282,6 +1154,50 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1282
  return new static($results);
1283
  }
1284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1285
  /**
1286
  * Sort the collection in descending order using the given callback.
1287
  *
@@ -1295,39 +1211,47 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1295
  }
1296
 
1297
  /**
1298
- * Splice a portion of the underlying collection array.
1299
  *
1300
- * @param int $offset
1301
- * @param int|null $length
1302
- * @param mixed $replacement
1303
  * @return static
1304
  */
1305
- public function splice($offset, $length = null, $replacement = [])
1306
  {
1307
- if (func_num_args() == 1) {
1308
- return new static(array_splice($this->items, $offset));
1309
- }
1310
 
1311
- return new static(array_splice($this->items, $offset, $length, $replacement));
 
 
1312
  }
1313
 
1314
  /**
1315
- * Get the sum of the given values.
1316
  *
1317
- * @param callable|string|null $callback
1318
- * @return mixed
1319
  */
1320
- public function sum($callback = null)
1321
  {
1322
- if (is_null($callback)) {
1323
- return array_sum($this->items);
1324
- }
1325
 
1326
- $callback = $this->valueRetriever($callback);
 
 
 
 
 
 
 
 
 
 
 
 
1327
 
1328
- return $this->reduce(function ($result, $item) use ($callback) {
1329
- return $result + $callback($item);
1330
- }, 0);
1331
  }
1332
 
1333
  /**
@@ -1346,16 +1270,25 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1346
  }
1347
 
1348
  /**
1349
- * Pass the collection to the given callback and then return it.
1350
  *
1351
- * @param callable $callback
1352
- * @return $this
1353
  */
1354
- public function tap(callable $callback)
1355
  {
1356
- $callback(new static($this->items));
 
1357
 
1358
- return $this;
 
 
 
 
 
 
 
 
1359
  }
1360
 
1361
  /**
@@ -1371,43 +1304,6 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1371
  return $this;
1372
  }
1373
 
1374
- /**
1375
- * Return only unique items from the collection array.
1376
- *
1377
- * @param string|callable|null $key
1378
- * @param bool $strict
1379
- * @return static
1380
- */
1381
- public function unique($key = null, $strict = false)
1382
- {
1383
- if (is_null($key)) {
1384
- return new static(array_unique($this->items, SORT_REGULAR));
1385
- }
1386
-
1387
- $callback = $this->valueRetriever($key);
1388
-
1389
- $exists = [];
1390
-
1391
- return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) {
1392
- if (in_array($id = $callback($item, $key), $exists, $strict)) {
1393
- return true;
1394
- }
1395
-
1396
- $exists[] = $id;
1397
- });
1398
- }
1399
-
1400
- /**
1401
- * Return only unique items from the collection array using strict comparison.
1402
- *
1403
- * @param string|callable|null $key
1404
- * @return static
1405
- */
1406
- public function uniqueStrict($key = null)
1407
- {
1408
- return $this->unique($key, true);
1409
- }
1410
-
1411
  /**
1412
  * Reset the keys on the underlying array.
1413
  *
@@ -1418,30 +1314,13 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1418
  return new static(array_values($this->items));
1419
  }
1420
 
1421
- /**
1422
- * Get a value retrieving callback.
1423
- *
1424
- * @param string $value
1425
- * @return callable
1426
- */
1427
- protected function valueRetriever($value)
1428
- {
1429
- if ($this->useAsCallable($value)) {
1430
- return $value;
1431
- }
1432
-
1433
- return function ($item) use ($value) {
1434
- return data_get($item, $value);
1435
- };
1436
- }
1437
-
1438
  /**
1439
  * Zip the collection together with one or more arrays.
1440
  *
1441
  * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]);
1442
  * => [[1, 4], [2, 5], [3, 6]]
1443
  *
1444
- * @param mixed ...$items
1445
  * @return static
1446
  */
1447
  public function zip($items)
@@ -1454,81 +1333,63 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1454
  return new static(func_get_args());
1455
  }, $this->items], $arrayableItems);
1456
 
1457
- return new static(call_user_func_array('array_map', $params));
1458
  }
1459
 
1460
  /**
1461
- * Get the collection of items as a plain array.
1462
  *
1463
- * @return array
 
 
1464
  */
1465
- public function toArray()
1466
  {
1467
- return array_map(function ($value) {
1468
- return $value instanceof Arrayable ? $value->toArray() : $value;
1469
- }, $this->items);
1470
  }
1471
 
1472
  /**
1473
- * Convert the object into something JSON serializable.
1474
  *
1475
- * @return array
1476
  */
1477
- public function jsonSerialize()
1478
  {
1479
- return array_map(function ($value) {
1480
- if ($value instanceof JsonSerializable) {
1481
- return $value->jsonSerialize();
1482
- } elseif ($value instanceof Jsonable) {
1483
- return json_decode($value->toJson(), true);
1484
- } elseif ($value instanceof Arrayable) {
1485
- return $value->toArray();
1486
- } else {
1487
- return $value;
1488
- }
1489
- }, $this->items);
1490
  }
1491
 
1492
  /**
1493
- * Get the collection of items as JSON.
1494
  *
1495
- * @param int $options
1496
- * @return string
1497
  */
1498
- public function toJson($options = 0)
1499
  {
1500
- return json_encode($this->jsonSerialize(), $options);
1501
  }
1502
 
1503
  /**
1504
- * Get an iterator for the items.
1505
  *
1506
- * @return \ArrayIterator
 
1507
  */
1508
- public function getIterator()
1509
  {
1510
- return new ArrayIterator($this->items);
1511
  }
1512
 
1513
  /**
1514
- * Get a CachingIterator instance.
1515
  *
1516
- * @param int $flags
1517
- * @return \CachingIterator
1518
  */
1519
- public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING)
1520
  {
1521
- return new CachingIterator($this->getIterator(), $flags);
1522
- }
1523
 
1524
- /**
1525
- * Count the number of items in the collection.
1526
- *
1527
- * @return int
1528
- */
1529
- public function count()
1530
- {
1531
- return count($this->items);
1532
  }
1533
 
1534
  /**
@@ -1549,7 +1410,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1549
  */
1550
  public function offsetExists($key)
1551
  {
1552
- return array_key_exists($key, $this->items);
1553
  }
1554
 
1555
  /**
@@ -1589,67 +1450,4 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
1589
  {
1590
  unset($this->items[$key]);
1591
  }
1592
-
1593
- /**
1594
- * Convert the collection to its string representation.
1595
- *
1596
- * @return string
1597
- */
1598
- public function __toString()
1599
- {
1600
- return $this->toJson();
1601
- }
1602
-
1603
- /**
1604
- * Results array of items from Collection or Arrayable.
1605
- *
1606
- * @param mixed $items
1607
- * @return array
1608
- */
1609
- protected function getArrayableItems($items)
1610
- {
1611
- if (is_array($items)) {
1612
- return $items;
1613
- } elseif ($items instanceof self) {
1614
- return $items->all();
1615
- } elseif ($items instanceof Arrayable) {
1616
- return $items->toArray();
1617
- } elseif ($items instanceof Jsonable) {
1618
- return json_decode($items->toJson(), true);
1619
- } elseif ($items instanceof JsonSerializable) {
1620
- return $items->jsonSerialize();
1621
- } elseif ($items instanceof Traversable) {
1622
- return iterator_to_array($items);
1623
- }
1624
-
1625
- return (array) $items;
1626
- }
1627
-
1628
- /**
1629
- * Add a method to the list of proxied methods.
1630
- *
1631
- * @param string $method
1632
- * @return void
1633
- */
1634
- public static function proxy($method)
1635
- {
1636
- static::$proxies[] = $method;
1637
- }
1638
-
1639
- /**
1640
- * Dynamically access collection proxies.
1641
- *
1642
- * @param string $key
1643
- * @return mixed
1644
- *
1645
- * @throws \Exception
1646
- */
1647
- public function __get($key)
1648
- {
1649
- if (! in_array($key, static::$proxies)) {
1650
- throw new Exception("Property [{$key}] does not exist on this collection instance.");
1651
- }
1652
-
1653
- return new HigherOrderCollectionProxy($this, $key);
1654
- }
1655
  }
2
 
3
  namespace Illuminate\Support;
4
 
 
 
5
  use ArrayAccess;
 
6
  use ArrayIterator;
7
+ use Illuminate\Support\Traits\EnumeratesValues;
 
 
8
  use Illuminate\Support\Traits\Macroable;
9
+ use stdClass;
 
10
 
11
+ class Collection implements ArrayAccess, Enumerable
12
  {
13
+ use EnumeratesValues, Macroable;
14
 
15
  /**
16
  * The items contained in the collection.
19
  */
20
  protected $items = [];
21
 
 
 
 
 
 
 
 
 
 
 
22
  /**
23
  * Create a new collection.
24
  *
31
  }
32
 
33
  /**
34
+ * Create a collection with the given range.
 
 
 
 
 
 
 
 
 
 
 
35
  *
36
+ * @param int $from
37
+ * @param int $to
38
  * @return static
39
  */
40
+ public static function range($from, $to)
41
  {
42
+ return new static(range($from, $to));
 
 
 
 
 
 
 
 
43
  }
44
 
45
  /**
53
  }
54
 
55
  /**
56
+ * Get a lazy collection for the items in this collection.
57
  *
58
+ * @return \Illuminate\Support\LazyCollection
 
59
  */
60
+ public function lazy()
61
  {
62
+ return new LazyCollection($this->items);
 
 
63
  }
64
 
65
  /**
66
+ * Get the average value of a given key.
67
  *
68
  * @param callable|string|null $callback
69
  * @return mixed
70
  */
71
+ public function avg($callback = null)
72
  {
73
+ $callback = $this->valueRetriever($callback);
74
+
75
+ $items = $this->map(function ($value) use ($callback) {
76
+ return $callback($value);
77
+ })->filter(function ($value) {
78
+ return ! is_null($value);
79
+ });
80
+
81
+ if ($count = $items->count()) {
82
+ return $items->sum() / $count;
83
+ }
84
  }
85
 
86
  /**
87
  * Get the median of a given key.
88
  *
89
+ * @param string|array|null $key
90
  * @return mixed
91
  */
92
  public function median($key = null)
93
  {
94
+ $values = (isset($key) ? $this->pluck($key) : $this)
95
+ ->filter(function ($item) {
96
+ return ! is_null($item);
97
+ })->sort()->values();
98
 
99
+ $count = $values->count();
100
+
101
+ if ($count === 0) {
102
  return;
103
  }
104
 
 
 
 
105
  $middle = (int) ($count / 2);
106
 
107
  if ($count % 2) {
116
  /**
117
  * Get the mode of a given key.
118
  *
119
+ * @param string|array|null $key
120
  * @return array|null
121
  */
122
  public function mode($key = null)
123
  {
124
+ if ($this->count() === 0) {
 
 
125
  return;
126
  }
127
 
128
  $collection = isset($key) ? $this->pluck($key) : $this;
129
 
130
+ $counts = new static;
131
 
132
  $collection->each(function ($value) use ($counts) {
133
  $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1;
162
  */
163
  public function contains($key, $operator = null, $value = null)
164
  {
165
+ if (func_num_args() === 1) {
166
  if ($this->useAsCallable($key)) {
167
+ $placeholder = new stdClass;
168
+
169
+ return $this->first($key, $placeholder) !== $placeholder;
170
  }
171
 
172
  return in_array($key, $this->items);
173
  }
174
 
175
+ return $this->contains($this->operatorForWhere(...func_get_args()));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  }
177
 
178
  /**
200
  }
201
 
202
  /**
203
+ * Get the items in the collection that are not present in the given items, using the callback.
204
  *
205
  * @param mixed $items
206
+ * @param callable $callback
207
  * @return static
208
  */
209
+ public function diffUsing($items, callable $callback)
210
  {
211
+ return new static(array_udiff($this->items, $this->getArrayableItems($items), $callback));
212
  }
213
 
214
  /**
215
+ * Get the items in the collection whose keys and values are not present in the given items.
216
  *
217
  * @param mixed $items
218
  * @return static
219
  */
220
+ public function diffAssoc($items)
 
 
 
 
 
 
 
 
 
 
 
221
  {
222
+ return new static(array_diff_assoc($this->items, $this->getArrayableItems($items)));
 
 
 
 
 
 
223
  }
224
 
225
  /**
226
+ * Get the items in the collection whose keys and values are not present in the given items, using the callback.
227
  *
228
+ * @param mixed $items
229
  * @param callable $callback
230
  * @return static
231
  */
232
+ public function diffAssocUsing($items, callable $callback)
233
  {
234
+ return new static(array_diff_uassoc($this->items, $this->getArrayableItems($items), $callback));
 
 
235
  }
236
 
237
  /**
238
+ * Get the items in the collection whose keys are not present in the given items.
239
  *
240
+ * @param mixed $items
241
+ * @return static
 
 
242
  */
243
+ public function diffKeys($items)
244
  {
245
+ return new static(array_diff_key($this->items, $this->getArrayableItems($items)));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
247
 
248
  /**
249
+ * Get the items in the collection whose keys are not present in the given items, using the callback.
250
  *
251
+ * @param mixed $items
252
+ * @param callable $callback
253
  * @return static
254
  */
255
+ public function diffKeysUsing($items, callable $callback)
256
  {
257
+ return new static(array_diff_ukey($this->items, $this->getArrayableItems($items), $callback));
 
 
258
  }
259
 
260
  /**
261
+ * Retrieve duplicate items from the collection.
262
  *
263
  * @param callable|null $callback
264
+ * @param bool $strict
265
  * @return static
266
  */
267
+ public function duplicates($callback = null, $strict = false)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  {
269
+ $items = $this->map($this->valueRetriever($callback));
 
 
 
 
270
 
271
+ $uniqueItems = $items->unique(null, $strict);
 
272
 
273
+ $compare = $this->duplicateComparator($strict);
 
 
 
 
 
 
 
 
 
 
 
274
 
275
+ $duplicates = new static;
 
 
 
 
 
 
 
 
 
 
 
276
 
277
+ foreach ($items as $key => $value) {
278
+ if ($uniqueItems->isNotEmpty() && $compare($value, $uniqueItems->first())) {
279
+ $uniqueItems->shift();
280
+ } else {
281
+ $duplicates[$key] = $value;
282
+ }
283
  }
284
 
285
+ return $duplicates;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  }
287
 
288
  /**
289
+ * Retrieve duplicate items from the collection using strict comparison.
290
  *
291
+ * @param callable|null $callback
 
292
  * @return static
293
  */
294
+ public function duplicatesStrict($callback = null)
295
  {
296
+ return $this->duplicates($callback, true);
297
  }
298
 
299
  /**
300
+ * Get the comparison function to detect duplicates.
301
  *
 
 
302
  * @param bool $strict
303
+ * @return \Closure
304
  */
305
+ protected function duplicateComparator($strict)
306
  {
307
+ if ($strict) {
308
+ return function ($a, $b) {
309
+ return $a === $b;
310
+ };
311
+ }
 
312
 
313
+ return function ($a, $b) {
314
+ return $a == $b;
315
+ };
 
 
 
 
 
 
 
316
  }
317
 
318
  /**
319
+ * Get all items except for those with the specified keys.
320
  *
321
+ * @param \Illuminate\Support\Collection|mixed $keys
 
 
322
  * @return static
323
  */
324
+ public function except($keys)
325
  {
326
+ if ($keys instanceof Enumerable) {
327
+ $keys = $keys->all();
328
+ } elseif (! is_array($keys)) {
329
+ $keys = func_get_args();
330
+ }
331
 
332
+ return new static(Arr::except($this->items, $keys));
 
 
333
  }
334
 
335
  /**
336
+ * Run a filter over each of the items.
337
  *
338
+ * @param callable|null $callback
 
339
  * @return static
340
  */
341
+ public function filter(callable $callback = null)
342
  {
343
+ if ($callback) {
344
+ return new static(Arr::where($this->items, $callback));
345
+ }
346
+
347
+ return new static(array_filter($this->items));
348
  }
349
 
350
  /**
351
+ * Get the first item from the collection passing the given truth test.
352
  *
353
  * @param callable|null $callback
354
  * @param mixed $default
404
  */
405
  public function get($key, $default = null)
406
  {
407
+ if (array_key_exists($key, $this->items)) {
408
  return $this->items[$key];
409
  }
410
 
414
  /**
415
  * Group an associative array by a field or using a callback.
416
  *
417
+ * @param array|callable|string $groupBy
418
  * @param bool $preserveKeys
419
  * @return static
420
  */
421
  public function groupBy($groupBy, $preserveKeys = false)
422
  {
423
+ if (! $this->useAsCallable($groupBy) && is_array($groupBy)) {
424
+ $nextGroups = $groupBy;
425
+
426
+ $groupBy = array_shift($nextGroups);
427
+ }
428
+
429
  $groupBy = $this->valueRetriever($groupBy);
430
 
431
  $results = [];
448
  }
449
  }
450
 
451
+ $result = new static($results);
452
+
453
+ if (! empty($nextGroups)) {
454
+ return $result->map->groupBy($nextGroups, $preserveKeys);
455
+ }
456
+
457
+ return $result;
458
  }
459
 
460
  /**
490
  */
491
  public function has($key)
492
  {
493
+ $keys = is_array($key) ? $key : func_get_args();
494
+
495
+ foreach ($keys as $value) {
496
+ if (! array_key_exists($value, $this->items)) {
497
+ return false;
498
+ }
499
+ }
500
+
501
+ return true;
502
  }
503
 
504
  /**
505
  * Concatenate values of a given key as a string.
506
  *
507
  * @param string $value
508
+ * @param string|null $glue
509
  * @return string
510
  */
511
  public function implode($value, $glue = null)
512
  {
513
  $first = $this->first();
514
 
515
+ if (is_array($first) || (is_object($first) && ! $first instanceof Stringable)) {
516
  return implode($glue, $this->pluck($value)->all());
517
  }
518
 
536
  * @param mixed $items
537
  * @return static
538
  */
539
+ public function intersectByKeys($items)
540
  {
541
+ return new static(array_intersect_key(
542
+ $this->items, $this->getArrayableItems($items)
543
+ ));
544
  }
545
 
546
  /**
554
  }
555
 
556
  /**
557
+ * Determine if the collection contains a single item.
558
  *
559
  * @return bool
560
  */
561
+ public function containsOneItem()
562
  {
563
+ return $this->count() === 1;
564
  }
565
 
566
  /**
567
+ * Join all items from the collection using a string. The final items can use a separate glue string.
568
  *
569
+ * @param string $glue
570
+ * @param string $finalGlue
571
+ * @return string
572
  */
573
+ public function join($glue, $finalGlue = '')
574
  {
575
+ if ($finalGlue === '') {
576
+ return $this->implode($glue);
577
+ }
578
+
579
+ $count = $this->count();
580
+
581
+ if ($count === 0) {
582
+ return '';
583
+ }
584
+
585
+ if ($count === 1) {
586
+ return $this->last();
587
+ }
588
+
589
+ $collection = new static($this->items);
590
+
591
+ $finalItem = $collection->pop();
592
+
593
+ return $collection->implode($glue).$finalGlue.$finalItem;
594
  }
595
 
596
  /**
618
  /**
619
  * Get the values of a given key.
620
  *
621
+ * @param string|array|int|null $value
622
  * @param string|null $key
623
  * @return static
624
  */
643
  }
644
 
645
  /**
646
+ * Run a dictionary map over the items.
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  *
648
  * The callback should return an associative array with a single key/value pair.
649
  *
650
  * @param callable $callback
651
  * @return static
652
  */
653
+ public function mapToDictionary(callable $callback)
654
  {
655
+ $dictionary = [];
656
+
657
+ foreach ($this->items as $key => $item) {
658
+ $pair = $callback($item, $key);
659
+
660
+ $key = key($pair);
661
+
662
+ $value = reset($pair);
663
+
664
+ if (! isset($dictionary[$key])) {
665
+ $dictionary[$key] = [];
666
+ }
667
 
668
+ $dictionary[$key][] = $value;
669
+ }
670
 
671
+ return new static($dictionary);
672
  }
673
 
674
  /**
695
  }
696
 
697
  /**
698
+ * Merge the collection with the given items.
699
  *
700
+ * @param mixed $items
701
  * @return static
702
  */
703
+ public function merge($items)
 
 
 
 
 
 
 
 
 
 
 
704
  {
705
+ return new static(array_merge($this->items, $this->getArrayableItems($items)));
 
 
 
 
 
 
 
 
706
  }
707
 
708
  /**
709
+ * Recursively merge the collection with the given items.
710
  *
711
  * @param mixed $items
712
  * @return static
713
  */
714
+ public function mergeRecursive($items)
715
  {
716
+ return new static(array_merge_recursive($this->items, $this->getArrayableItems($items)));
717
  }
718
 
719
  /**
739
  }
740
 
741
  /**
742
+ * Create a new collection consisting of every n-th element.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
743
  *
744
  * @param int $step
745
  * @param int $offset
774
  return new static($this->items);
775
  }
776
 
777
+ if ($keys instanceof Enumerable) {
778
+ $keys = $keys->all();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
779
  }
780
 
781
+ $keys = is_array($keys) ? $keys : func_get_args();
 
782
 
783
+ return new static(Arr::only($this->items, $keys));
 
 
 
 
 
 
 
 
784
  }
785
 
786
  /**
802
  */
803
  public function prepend($value, $key = null)
804
  {
805
+ $this->items = Arr::prepend($this->items, ...func_get_args());
806
 
807
  return $this;
808
  }
809
 
810
  /**
811
+ * Push one or more items onto the end of the collection.
812
  *
813
+ * @param mixed $values [optional]
814
  * @return $this
815
  */
816
+ public function push(...$values)
817
  {
818
+ foreach ($values as $value) {
819
+ $this->items[] = $value;
820
+ }
821
 
822
  return $this;
823
  }
825
  /**
826
  * Push all of the given items onto the collection.
827
  *
828
+ * @param iterable $source
829
+ * @return static
830
  */
831
  public function concat($source)
832
  {
869
  * Get one or a specified number of items randomly from the collection.
870
  *
871
  * @param int|null $number
872
+ * @return static|mixed
873
  *
874
  * @throws \InvalidArgumentException
875
  */
883
  }
884
 
885
  /**
886
+ * Replace the collection items with the given items.
887
  *
888
+ * @param mixed $items
889
+ * @return static
 
890
  */
891
+ public function replace($items)
892
  {
893
+ return new static(array_replace($this->items, $this->getArrayableItems($items)));
894
  }
895
 
896
  /**
897
+ * Recursively replace the collection items with the given items.
898
  *
899
+ * @param mixed $items
900
  * @return static
901
  */
902
+ public function replaceRecursive($items)
903
  {
904
+ return new static(array_replace_recursive($this->items, $this->getArrayableItems($items)));
 
 
 
 
 
 
 
 
905
  }
906
 
907
  /**
928
  }
929
 
930
  foreach ($this->items as $key => $item) {
931
+ if ($value($item, $key)) {
932
  return $key;
933
  }
934
  }
949
  /**
950
  * Shuffle the items in the collection.
951
  *
952
+ * @param int|null $seed
953
  * @return static
954
  */
955
  public function shuffle($seed = null)
956
  {
957
+ return new static(Arr::shuffle($this->items, $seed));
958
+ }
959
 
960
+ /**
961
+ * Skip the first {$count} items.
962
+ *
963
+ * @param int $count
964
+ * @return static
965
+ */
966
+ public function skip($count)
967
+ {
968
+ return $this->slice($count);
969
+ }
970
 
971
+ /**
972
+ * Skip items in the collection until the given condition is met.
973
+ *
974
+ * @param mixed $value
975
+ * @return static
976
+ */
977
+ public function skipUntil($value)
978
+ {
979
+ return new static($this->lazy()->skipUntil($value)->all());
980
+ }
981
 
982
+ /**
983
+ * Skip items in the collection while the given condition is met.
984
+ *
985
+ * @param mixed $value
986
+ * @return static
987
+ */
988
+ public function skipWhile($value)
989
+ {
990
+ return new static($this->lazy()->skipWhile($value)->all());
991
  }
992
 
993
  /**
994
  * Slice the underlying collection array.
995
  *
996
  * @param int $offset
997
+ * @param int|null $length
998
  * @return static
999
  */
1000
  public function slice($offset, $length = null)
1014
  return new static;
1015
  }
1016
 
1017
+ $groups = new static;
1018
+
1019
+ $groupSize = floor($this->count() / $numberOfGroups);
1020
+
1021
+ $remain = $this->count() % $numberOfGroups;
1022
 
1023
+ $start = 0;
1024
+
1025
+ for ($i = 0; $i < $numberOfGroups; $i++) {
1026
+ $size = $groupSize;
1027
+
1028
+ if ($i < $remain) {
1029
+ $size++;
1030
+ }
1031
+
1032
+ if ($size) {
1033
+ $groups->push(new static(array_slice($this->items, $start, $size)));
1034
+
1035
+ $start += $size;
1036
+ }
1037
+ }
1038
+
1039
+ return $groups;
1040
  }
1041
 
1042
  /**
1043
+ * Split a collection into a certain number of groups, and fill the first groups completely.
1044
+ *
1045
+ * @param int $numberOfGroups
1046
+ * @return static
1047
+ */
1048
+ public function splitIn($numberOfGroups)
1049
+ {
1050
+ return $this->chunk(ceil($this->count() / $numberOfGroups));
1051
+ }
1052
+
1053
+ /**
1054
+ * Chunk the collection into chunks of the given size.
1055
  *
1056
  * @param int $size
1057
  * @return static
1071
  return new static($chunks);
1072
  }
1073
 
1074
+ /**
1075
+ * Chunk the collection into chunks with a callback.
1076
+ *
1077
+ * @param callable $callback
1078
+ * @return static
1079
+ */
1080
+ public function chunkWhile(callable $callback)
1081
+ {
1082
+ return new static(
1083
+ $this->lazy()->chunkWhile($callback)->mapInto(static::class)
1084
+ );
1085
+ }
1086
+
1087
  /**
1088
  * Sort through each item with a callback.
1089
  *
1090
+ * @param callable|int|null $callback
1091
  * @return static
1092
  */
1093
+ public function sort($callback = null)
1094
  {
1095
  $items = $this->items;
1096
 
1097
+ $callback && is_callable($callback)
1098
  ? uasort($items, $callback)
1099
+ : asort($items, $callback ?? SORT_REGULAR);
1100
+
1101
+ return new static($items);
1102
+ }
1103
+
1104
+ /**
1105
+ * Sort items in descending order.
1106
+ *
1107
+ * @param int $options
1108
+ * @return static
1109
+ */
1110
+ public function sortDesc($options = SORT_REGULAR)
1111
+ {
1112
+ $items = $this->items;
1113
+
1114
+ arsort($items, $options);
1115
 
1116
  return new static($items);
1117
  }
1119
  /**
1120
  * Sort the collection using the given callback.
1121
  *
1122
+ * @param callable|array|string $callback
1123
  * @param int $options
1124
  * @param bool $descending
1125
  * @return static
1126
  */
1127
  public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
1128
  {
1129
+ if (is_array($callback) && ! is_callable($callback)) {
1130
+ return $this->sortByMany($callback);
1131
+ }
1132
+
1133
  $results = [];
1134
 
1135
  $callback = $this->valueRetriever($callback);
1142
  }
1143
 
1144
  $descending ? arsort($results, $options)
1145
+ : asort($results, $options);
1146
 
1147
  // Once we have sorted all of the keys in the array, we will loop through them
1148
  // and grab the corresponding model so we can set the underlying items list
1154
  return new static($results);
1155
  }
1156
 
1157
+ /**
1158
+ * Sort the collection using multiple comparisons.
1159
+ *
1160
+ * @param array $comparisons
1161
+ * @return static
1162
+ */
1163
+ protected function sortByMany(array $comparisons = [])
1164
+ {
1165
+ $items = $this->items;
1166
+
1167
+ usort($items, function ($a, $b) use ($comparisons) {
1168
+ foreach ($comparisons as $comparison) {
1169
+ $comparison = Arr::wrap($comparison);
1170
+
1171
+ $prop = $comparison[0];
1172
+
1173
+ $ascending = Arr::get($comparison, 1, true) === true ||
1174
+ Arr::get($comparison, 1, true) === 'asc';
1175
+
1176
+ $result = 0;
1177
+
1178
+ if (is_callable($prop)) {
1179
+ $result = $prop($a, $b);
1180
+ } else {
1181
+ $values = [data_get($a, $prop), data_get($b, $prop)];
1182
+
1183
+ if (! $ascending) {
1184
+ $values = array_reverse($values);
1185
+ }
1186
+
1187
+ $result = $values[0] <=> $values[1];
1188
+ }
1189
+
1190
+ if ($result === 0) {
1191
+ continue;
1192
+ }
1193
+
1194
+ return $result;
1195
+ }
1196
+ });
1197
+
1198
+ return new static($items);
1199
+ }
1200
+
1201
  /**
1202
  * Sort the collection in descending order using the given callback.
1203
  *
1211
  }
1212
 
1213
  /**
1214
+ * Sort the collection keys.
1215
  *
1216
+ * @param int $options
1217
+ * @param bool $descending
 
1218
  * @return static
1219
  */
1220
+ public function sortKeys($options = SORT_REGULAR, $descending = false)
1221
  {
1222
+ $items = $this->items;
 
 
1223
 
1224
+ $descending ? krsort($items, $options) : ksort($items, $options);
1225
+
1226
+ return new static($items);
1227
  }
1228
 
1229
  /**
1230
+ * Sort the collection keys in descending order.
1231
  *
1232
+ * @param int $options
1233
+ * @return static
1234
  */
1235
+ public function sortKeysDesc($options = SORT_REGULAR)
1236
  {
1237
+ return $this->sortKeys($options, true);
1238
+ }
 
1239
 
1240
+ /**
1241
+ * Splice a portion of the underlying collection array.
1242
+ *
1243
+ * @param int $offset
1244
+ * @param int|null $length
1245
+ * @param mixed $replacement
1246
+ * @return static
1247
+ */
1248
+ public function splice($offset, $length = null, $replacement = [])
1249
+ {
1250
+ if (func_num_args() === 1) {
1251
+ return new static(array_splice($this->items, $offset));
1252
+ }
1253
 
1254
+ return new static(array_splice($this->items, $offset, $length, $replacement));
 
 
1255
  }
1256
 
1257
  /**
1270
  }
1271
 
1272
  /**
1273
+ * Take items in the collection until the given condition is met.
1274
  *
1275
+ * @param mixed $value
1276
+ * @return static
1277
  */
1278
+ public function takeUntil($value)
1279
  {
1280
+ return new static($this->lazy()->takeUntil($value)->all());
1281
+ }
1282
 
1283
+ /**
1284
+ * Take items in the collection while the given condition is met.
1285
+ *
1286
+ * @param mixed $value
1287
+ * @return static
1288
+ */
1289
+ public function takeWhile($value)
1290
+ {
1291
+ return new static($this->lazy()->takeWhile($value)->all());
1292
  }
1293
 
1294
  /**
1304
  return $this;
1305
  }
1306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1307
  /**
1308
  * Reset the keys on the underlying array.
1309
  *
1314
  return new static(array_values($this->items));
1315
  }
1316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1317
  /**
1318
  * Zip the collection together with one or more arrays.
1319
  *
1320
  * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]);
1321
  * => [[1, 4], [2, 5], [3, 6]]
1322
  *
1323
+ * @param mixed ...$items
1324
  * @return static
1325
  */
1326
  public function zip($items)
1333
  return new static(func_get_args());
1334
  }, $this->items], $arrayableItems);
1335
 
1336
+ return new static(array_map(...$params));
1337
  }
1338
 
1339
  /**
1340
+ * Pad collection to the specified length with a value.
1341
  *
1342
+ * @param int $size
1343
+ * @param mixed $value
1344
+ * @return static
1345
  */
1346
+ public function pad($size, $value)
1347
  {
1348
+ return new static(array_pad($this->items, $size, $value));
 
 
1349
  }
1350
 
1351
  /**
1352
+ * Get an iterator for the items.
1353
  *
1354
+ * @return \ArrayIterator
1355
  */
1356
+ public function getIterator()
1357
  {
1358
+ return new ArrayIterator($this->items);
 
 
 
 
 
 
 
 
 
 
1359
  }
1360
 
1361
  /**
1362
+ * Count the number of items in the collection.
1363
  *
1364
+ * @return int
 
1365
  */
1366
+ public function count()
1367
  {
1368
+ return count($this->items);
1369
  }
1370
 
1371
  /**
1372
+ * Count the number of items in the collection by a field or using a callback.
1373
  *
1374
+ * @param callable|string $countBy
1375
+ * @return static
1376
  */
1377
+ public function countBy($countBy = null)
1378
  {
1379
+ return new static($this->lazy()->countBy($countBy)->all());
1380
  }
1381
 
1382
  /**
1383
+ * Add an item to the collection.
1384
  *
1385
+ * @param mixed $item
1386
+ * @return $this
1387
  */
1388
+ public function add($item)
1389
  {
1390
+ $this->items[] = $item;
 
1391
 
1392
+ return $this;
 
 
 
 
 
 
 
1393
  }
1394
 
1395
  /**
1410
  */
1411
  public function offsetExists($key)
1412
  {
1413
+ return isset($this->items[$key]);
1414
  }
1415
 
1416
  /**
1450
  {
1451
  unset($this->items[$key]);
1452
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1453
  }
vendor/illuminate/collections/Enumerable.php ADDED
@@ -0,0 +1,1027 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use Countable;
6
+ use Illuminate\Contracts\Support\Arrayable;
7
+ use Illuminate\Contracts\Support\Jsonable;
8
+ use IteratorAggregate;
9
+ use JsonSerializable;
10
+
11
+ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable
12
+ {
13
+ /**
14
+ * Create a new collection instance if the value isn't one already.
15
+ *
16
+ * @param mixed $items
17
+ * @return static
18
+ */
19
+ public static function make($items = []);
20
+
21
+ /**
22
+ * Create a new instance by invoking the callback a given amount of times.
23
+ *
24
+ * @param int $number
25
+ * @param callable|null $callback
26
+ * @return static
27
+ */
28
+ public static function times($number, callable $callback = null);
29
+
30
+ /**
31
+ * Create a collection with the given range.
32
+ *
33
+ * @param int $from
34
+ * @param int $to
35
+ * @return static
36
+ */
37
+ public static function range($from, $to);
38
+
39
+ /**
40
+ * Wrap the given value in a collection if applicable.
41
+ *
42
+ * @param mixed $value
43
+ * @return static
44
+ */
45
+ public static function wrap($value);
46
+
47
+ /**
48
+ * Get the underlying items from the given collection if applicable.
49
+ *
50
+ * @param array|static $value
51
+ * @return array
52
+ */
53
+ public static function unwrap($value);
54
+
55
+ /**
56
+ * Create a new instance with no items.
57
+ *
58
+ * @return static
59
+ */
60
+ public static function empty();
61
+
62
+ /**
63
+ * Get all items in the enumerable.
64
+ *
65
+ * @return array
66
+ */
67
+ public function all();
68
+
69
+ /**
70
+ * Alias for the "avg" method.
71
+ *
72
+ * @param callable|string|null $callback
73
+ * @return mixed
74
+ */
75
+ public function average($callback = null);
76
+
77
+ /**
78
+ * Get the median of a given key.
79
+ *
80
+ * @param string|array|null $key
81
+ * @return mixed
82
+ */
83
+ public function median($key = null);
84
+
85
+ /**
86
+ * Get the mode of a given key.
87
+ *
88
+ * @param string|array|null $key
89
+ * @return array|null
90
+ */
91
+ public function mode($key = null);
92
+
93
+ /**
94
+ * Collapse the items into a single enumerable.
95
+ *
96
+ * @return static
97
+ */
98
+ public function collapse();
99
+
100
+ /**
101
+ * Alias for the "contains" method.
102
+ *
103
+ * @param mixed $key
104
+ * @param mixed $operator
105
+ * @param mixed $value
106
+ * @return bool
107
+ */
108
+ public function some($key, $operator = null, $value = null);
109
+
110
+ /**
111
+ * Determine if an item exists, using strict comparison.
112
+ *
113
+ * @param mixed $key
114
+ * @param mixed $value
115
+ * @return bool
116
+ */
117
+ public function containsStrict($key, $value = null);
118
+
119
+ /**
120
+ * Get the average value of a given key.
121
+ *
122
+ * @param callable|string|null $callback
123
+ * @return mixed
124
+ */
125
+ public function avg($callback = null);
126
+
127
+ /**
128
+ * Determine if an item exists in the enumerable.
129
+ *
130
+ * @param mixed $key
131
+ * @param mixed $operator
132
+ * @param mixed $value
133
+ * @return bool
134
+ */
135
+ public function contains($key, $operator = null, $value = null);
136
+
137
+ /**
138
+ * Cross join with the given lists, returning all possible permutations.
139
+ *
140
+ * @param mixed ...$lists
141
+ * @return static
142
+ */
143
+ public function crossJoin(...$lists);
144
+
145
+ /**
146
+ * Dump the collection and end the script.
147
+ *
148
+ * @param mixed ...$args
149
+ * @return void
150
+ */
151
+ public function dd(...$args);
152
+
153
+ /**
154
+ * Dump the collection.
155
+ *
156
+ * @return $this
157
+ */
158
+ public function dump();
159
+
160
+ /**
161
+ * Get the items that are not present in the given items.
162
+ *
163
+ * @param mixed $items
164
+ * @return static
165
+ */
166
+ public function diff($items);
167
+
168
+ /**
169
+ * Get the items that are not present in the given items, using the callback.
170
+ *
171
+ * @param mixed $items
172
+ * @param callable $callback
173
+ * @return static
174
+ */
175
+ public function diffUsing($items, callable $callback);
176
+
177
+ /**
178
+ * Get the items whose keys and values are not present in the given items.
179
+ *
180
+ * @param mixed $items
181
+ * @return static
182
+ */
183
+ public function diffAssoc($items);
184
+
185
+ /**
186
+ * Get the items whose keys and values are not present in the given items, using the callback.
187
+ *
188
+ * @param mixed $items
189
+ * @param callable $callback
190
+ * @return static
191
+ */
192
+ public function diffAssocUsing($items, callable $callback);
193
+
194
+ /**
195
+ * Get the items whose keys are not present in the given items.
196
+ *
197
+ * @param mixed $items
198
+ * @return static
199
+ */
200
+ public function diffKeys($items);
201
+
202
+ /**
203
+ * Get the items whose keys are not present in the given items, using the callback.
204
+ *
205
+ * @param mixed $items
206
+ * @param callable $callback
207
+ * @return static
208
+ */
209
+ public function diffKeysUsing($items, callable $callback);
210
+
211
+ /**
212
+ * Retrieve duplicate items.
213
+ *
214
+ * @param callable|null $callback
215
+ * @param bool $strict
216
+ * @return static
217
+ */
218
+ public function duplicates($callback = null, $strict = false);
219
+
220
+ /**
221
+ * Retrieve duplicate items using strict comparison.
222
+ *
223
+ * @param callable|null $callback
224
+ * @return static
225
+ */
226
+ public function duplicatesStrict($callback = null);
227
+
228
+ /**
229
+ * Execute a callback over each item.
230
+ *
231
+ * @param callable $callback
232
+ * @return $this
233
+ */
234
+ public function each(callable $callback);
235
+
236
+ /**
237
+ * Execute a callback over each nested chunk of items.
238
+ *
239
+ * @param callable $callback
240
+ * @return static
241
+ */
242
+ public function eachSpread(callable $callback);
243
+
244
+ /**
245
+ * Determine if all items pass the given truth test.
246
+ *
247
+ * @param string|callable $key
248
+ * @param mixed $operator
249
+ * @param mixed $value
250
+ * @return bool
251
+ */
252
+ public function every($key, $operator = null, $value = null);
253
+
254
+ /**
255
+ * Get all items except for those with the specified keys.
256
+ *
257
+ * @param mixed $keys
258
+ * @return static
259
+ */
260
+ public function except($keys);
261
+
262
+ /**
263
+ * Run a filter over each of the items.
264
+ *
265
+ * @param callable|null $callback
266
+ * @return static
267
+ */
268
+ public function filter(callable $callback = null);
269
+
270
+ /**
271
+ * Apply the callback if the value is truthy.
272
+ *
273
+ * @param bool $value
274
+ * @param callable $callback
275
+ * @param callable|null $default
276
+ * @return static|mixed
277
+ */
278
+ public function when($value, callable $callback, callable $default = null);
279
+
280
+ /**
281
+ * Apply the callback if the collection is empty.
282
+ *
283
+ * @param callable $callback
284
+ * @param callable|null $default
285
+ * @return static|mixed
286
+ */
287
+ public function whenEmpty(callable $callback, callable $default = null);
288
+
289
+ /**
290
+ * Apply the callback if the collection is not empty.
291
+ *
292
+ * @param callable $callback
293
+ * @param callable|null $default
294
+ * @return static|mixed
295
+ */
296
+ public function whenNotEmpty(callable $callback, callable $default = null);
297
+
298
+ /**
299
+ * Apply the callback if the value is falsy.
300
+ *
301
+ * @param bool $value
302
+ * @param callable $callback
303
+ * @param callable|null $default
304
+ * @return static|mixed
305
+ */
306
+ public function unless($value, callable $callback, callable $default = null);
307
+
308
+ /**
309
+ * Apply the callback unless the collection is empty.
310
+ *
311
+ * @param callable $callback
312
+ * @param callable|null $default
313
+ * @return static|mixed
314
+ */
315
+ public function unlessEmpty(callable $callback, callable $default = null);
316
+
317
+ /**
318
+ * Apply the callback unless the collection is not empty.
319
+ *
320
+ * @param callable $callback
321
+ * @param callable|null $default
322
+ * @return static|mixed
323
+ */
324
+ public function unlessNotEmpty(callable $callback, callable $default = null);
325
+
326
+ /**
327
+ * Filter items by the given key value pair.
328
+ *
329
+ * @param string $key
330
+ * @param mixed $operator
331
+ * @param mixed $value
332
+ * @return static
333
+ */
334
+ public function where($key, $operator = null, $value = null);
335
+
336
+ /**
337
+ * Filter items where the value for the given key is null.
338
+ *
339
+ * @param string|null $key
340
+ * @return static
341
+ */
342
+ public function whereNull($key = null);
343
+
344
+ /**
345
+ * Filter items where the value for the given key is not null.
346
+ *
347
+ * @param string|null $key
348
+ * @return static
349
+ */
350
+ public function whereNotNull($key = null);
351
+
352
+ /**
353
+ * Filter items by the given key value pair using strict comparison.
354
+ *
355
+ * @param string $key
356
+ * @param mixed $value
357
+ * @return static
358
+ */
359
+ public function whereStrict($key, $value);
360
+
361
+ /**
362
+ * Filter items by the given key value pair.
363
+ *
364
+ * @param string $key
365
+ * @param mixed $values
366
+ * @param bool $strict
367
+ * @return static
368
+ */
369
+ public function whereIn($key, $values, $strict = false);
370
+
371
+ /**
372
+ * Filter items by the given key value pair using strict comparison.
373
+ *
374
+ * @param string $key
375
+ * @param mixed $values
376
+ * @return static
377
+ */
378
+ public function whereInStrict($key, $values);
379
+
380
+ /**
381
+ * Filter items such that the value of the given key is between the given values.
382
+ *
383
+ * @param string $key
384
+ * @param array $values
385
+ * @return static
386
+ */
387
+ public function whereBetween($key, $values);
388
+
389
+ /**
390
+ * Filter items such that the value of the given key is not between the given values.
391
+ *
392
+ * @param string $key
393
+ * @param array $values
394
+ * @return static
395
+ */
396
+ public function whereNotBetween($key, $values);
397
+
398
+ /**
399
+ * Filter items by the given key value pair.
400
+ *
401
+ * @param string $key
402
+ * @param mixed $values
403
+ * @param bool $strict
404
+ * @return static
405
+ */
406
+ public function whereNotIn($key, $values, $strict = false);
407
+
408
+ /**
409
+ * Filter items by the given key value pair using strict comparison.
410
+ *
411
+ * @param string $key
412
+ * @param mixed $values
413
+ * @return static
414
+ */
415
+ public function whereNotInStrict($key, $values);
416
+
417
+ /**
418
+ * Filter the items, removing any items that don't match the given type(s).
419
+ *
420
+ * @param string|string[] $type
421
+ * @return static
422
+ */
423
+ public function whereInstanceOf($type);
424
+
425
+ /**
426
+ * Get the first item from the enumerable passing the given truth test.
427
+ *
428
+ * @param callable|null $callback
429
+ * @param mixed $default
430
+ * @return mixed
431
+ */
432
+ public function first(callable $callback = null, $default = null);
433
+
434
+ /**
435
+ * Get the first item by the given key value pair.
436
+ *
437
+ * @param string $key
438
+ * @param mixed $operator
439
+ * @param mixed $value
440
+ * @return mixed
441
+ */
442
+ public function firstWhere($key, $operator = null, $value = null);
443
+
444
+ /**
445
+ * Get a flattened array of the items in the collection.
446
+ *
447
+ * @param int $depth
448
+ * @return static
449
+ */
450
+ public function flatten($depth = INF);
451
+
452
+ /**
453
+ * Flip the values with their keys.
454
+ *
455
+ * @return static
456
+ */
457
+ public function flip();
458
+
459
+ /**
460
+ * Get an item from the collection by key.
461
+ *
462
+ * @param mixed $key
463
+ * @param mixed $default
464
+ * @return mixed
465
+ */
466
+ public function get($key, $default = null);
467
+
468
+ /**
469
+ * Group an associative array by a field or using a callback.
470
+ *
471
+ * @param array|callable|string $groupBy
472
+ * @param bool $preserveKeys
473
+ * @return static
474
+ */
475
+ public function groupBy($groupBy, $preserveKeys = false);
476
+
477
+ /**
478
+ * Key an associative array by a field or using a callback.
479
+ *
480
+ * @param callable|string $keyBy
481
+ * @return static
482
+ */
483
+ public function keyBy($keyBy);
484
+
485
+ /**
486
+ * Determine if an item exists in the collection by key.
487
+ *
488
+ * @param mixed $key
489
+ * @return bool
490
+ */
491
+ public function has($key);
492
+
493
+ /**
494
+ * Concatenate values of a given key as a string.
495
+ *
496
+ * @param string $value
497
+ * @param string|null $glue
498
+ * @return string
499
+ */
500
+ public function implode($value, $glue = null);
501
+
502
+ /**
503
+ * Intersect the collection with the given items.
504
+ *
505
+ * @param mixed $items
506
+ * @return static
507
+ */
508
+ public function intersect($items);
509
+
510
+ /**
511
+ * Intersect the collection with the given items by key.
512
+ *
513
+ * @param mixed $items
514
+ * @return static
515
+ */
516
+ public function intersectByKeys($items);
517
+
518
+ /**
519
+ * Determine if the collection is empty or not.
520
+ *
521
+ * @return bool
522
+ */
523
+ public function isEmpty();
524
+
525
+ /**
526
+ * Determine if the collection is not empty.
527
+ *
528
+ * @return bool
529
+ */
530
+ public function isNotEmpty();
531
+
532
+ /**
533
+ * Join all items from the collection using a string. The final items can use a separate glue string.
534
+ *
535
+ * @param string $glue
536
+ * @param string $finalGlue
537
+ * @return string
538
+ */
539
+ public function join($glue, $finalGlue = '');
540
+
541
+ /**
542
+ * Get the keys of the collection items.
543
+ *
544
+ * @return static
545
+ */
546
+ public function keys();
547
+
548
+ /**
549
+ * Get the last item from the collection.
550
+ *
551
+ * @param callable|null $callback
552
+ * @param mixed $default
553
+ * @return mixed
554
+ */
555
+ public function last(callable $callback = null, $default = null);
556
+
557
+ /**
558
+ * Run a map over each of the items.
559
+ *
560
+ * @param callable $callback
561
+ * @return static
562
+ */
563
+ public function map(callable $callback);
564
+
565
+ /**
566
+ * Run a map over each nested chunk of items.
567
+ *
568
+ * @param callable $callback
569
+ * @return static
570
+ */
571
+ public function mapSpread(callable $callback);
572
+
573
+ /**
574
+ * Run a dictionary map over the items.
575
+ *
576
+ * The callback should return an associative array with a single key/value pair.
577
+ *
578
+ * @param callable $callback
579
+ * @return static
580
+ */
581
+ public function mapToDictionary(callable $callback);
582
+
583
+ /**
584
+ * Run a grouping map over the items.
585
+ *
586
+ * The callback should return an associative array with a single key/value pair.
587
+ *
588
+ * @param callable $callback
589
+ * @return static
590
+ */
591
+ public function mapToGroups(callable $callback);
592
+
593
+ /**
594
+ * Run an associative map over each of the items.
595
+ *
596
+ * The callback should return an associative array with a single key/value pair.
597
+ *
598
+ * @param callable $callback
599
+ * @return static
600
+ */
601
+ public function mapWithKeys(callable $callback);
602
+
603
+ /**
604
+ * Map a collection and flatten the result by a single level.
605
+ *
606
+ * @param callable $callback
607
+ * @return static
608
+ */
609
+ public function flatMap(callable $callback);
610
+
611
+ /**
612
+ * Map the values into a new class.
613
+ *
614
+ * @param string $class
615
+ * @return static
616
+ */
617
+ public function mapInto($class);
618
+
619
+ /**
620
+ * Merge the collection with the given items.
621
+ *
622
+ * @param mixed $items
623
+ * @return static
624
+ */
625
+ public function merge($items);
626
+
627
+ /**
628
+ * Recursively merge the collection with the given items.
629
+ *
630
+ * @param mixed $items
631
+ * @return static
632
+ */
633
+ public function mergeRecursive($items);
634
+
635
+ /**
636
+ * Create a collection by using this collection for keys and another for its values.
637
+ *
638
+ * @param mixed $values
639
+ * @return static
640
+ */
641
+ public function combine($values);
642
+
643
+ /**
644
+ * Union the collection with the given items.
645
+ *
646
+ * @param mixed $items
647
+ * @return static
648
+ */
649
+ public function union($items);
650
+
651
+ /**
652
+ * Get the min value of a given key.
653
+ *
654
+ * @param callable|string|null $callback
655
+ * @return mixed
656
+ */
657
+ public function min($callback = null);
658
+
659
+ /**
660
+ * Get the max value of a given key.
661
+ *
662
+ * @param callable|string|null $callback
663
+ * @return mixed
664
+ */
665
+ public function max($callback = null);
666
+
667
+ /**
668
+ * Create a new collection consisting of every n-th element.
669
+ *
670
+ * @param int $step
671
+ * @param int $offset
672
+ * @return static
673
+ */
674
+ public function nth($step, $offset = 0);
675
+
676
+ /**
677
+ * Get the items with the specified keys.
678
+ *
679
+ * @param mixed $keys
680
+ * @return static
681
+ */
682
+ public function only($keys);
683
+
684
+ /**
685
+ * "Paginate" the collection by slicing it into a smaller collection.
686
+ *
687
+ * @param int $page
688
+ * @param int $perPage
689
+ * @return static
690
+ */
691
+ public function forPage($page, $perPage);
692
+
693
+ /**
694
+ * Partition the collection into two arrays using the given callback or key.
695
+ *
696
+ * @param callable|string $key
697
+ * @param mixed $operator
698
+ * @param mixed $value
699
+ * @return static
700
+ */
701
+ public function partition($key, $operator = null, $value = null);
702
+
703
+ /**
704
+ * Push all of the given items onto the collection.
705
+ *
706
+ * @param iterable $source
707
+ * @return static
708
+ */
709
+ public function concat($source);
710
+
711
+ /**
712
+ * Get one or a specified number of items randomly from the collection.
713
+ *
714
+ * @param int|null $number
715
+ * @return static|mixed
716
+ *
717
+ * @throws \InvalidArgumentException
718
+ */
719
+ public function random($number = null);
720
+
721
+ /**
722
+ * Reduce the collection to a single value.
723
+ *
724
+ * @param callable $callback
725
+ * @param mixed $initial
726
+ * @return mixed
727
+ */
728
+ public function reduce(callable $callback, $initial = null);
729
+
730
+ /**
731
+ * Replace the collection items with the given items.
732
+ *
733
+ * @param mixed $items
734
+ * @return static
735
+ */
736
+ public function replace($items);
737
+
738
+ /**
739
+ * Recursively replace the collection items with the given items.
740
+ *
741
+ * @param mixed $items
742
+ * @return static
743
+ */
744
+ public function replaceRecursive($items);
745
+
746
+ /**
747
+ * Reverse items order.
748
+ *
749
+ * @return static
750
+ */
751
+ public function reverse();
752
+
753
+ /**
754
+ * Search the collection for a given value and return the corresponding key if successful.
755
+ *
756
+ * @param mixed $value
757
+ * @param bool $strict
758
+ * @return mixed
759
+ */
760
+ public function search($value, $strict = false);
761
+
762
+ /**
763
+ * Shuffle the items in the collection.
764
+ *
765
+ * @param int|null $seed
766
+ * @return static
767
+ */
768
+ public function shuffle($seed = null);
769
+
770
+ /**
771
+ * Skip the first {$count} items.
772
+ *
773
+ * @param int $count
774
+ * @return static
775
+ */
776
+ public function skip($count);
777
+
778
+ /**
779
+ * Skip items in the collection until the given condition is met.
780
+ *
781
+ * @param mixed $value
782
+ * @return static
783
+ */
784
+ public function skipUntil($value);
785
+
786
+ /**
787
+ * Skip items in the collection while the given condition is met.
788
+ *
789
+ * @param mixed $value
790
+ * @return static
791
+ */
792
+ public function skipWhile($value);
793
+
794
+ /**
795
+ * Get a slice of items from the enumerable.
796
+ *
797
+ * @param int $offset
798
+ * @param int|null $length
799
+ * @return static
800
+ */
801
+ public function slice($offset, $length = null);
802
+
803
+ /**
804
+ * Split a collection into a certain number of groups.
805
+ *
806
+ * @param int $numberOfGroups
807
+ * @return static
808
+ */
809
+ public function split($numberOfGroups);
810
+
811
+ /**
812
+ * Chunk the collection into chunks of the given size.
813
+ *
814
+ * @param int $size
815
+ * @return static
816
+ */
817
+ public function chunk($size);
818
+
819
+ /**
820
+ * Chunk the collection into chunks with a callback.
821
+ *
822
+ * @param callable $callback
823
+ * @return static
824
+ */
825
+ public function chunkWhile(callable $callback);
826
+
827
+ /**
828
+ * Sort through each item with a callback.
829
+ *
830
+ * @param callable|null|int $callback
831
+ * @return static
832
+ */
833
+ public function sort($callback = null);
834
+
835
+ /**
836
+ * Sort items in descending order.
837
+ *
838
+ * @param int $options
839
+ * @return static
840
+ */
841
+ public function sortDesc($options = SORT_REGULAR);
842
+
843
+ /**
844
+ * Sort the collection using the given callback.
845
+ *
846
+ * @param callable|string $callback
847
+ * @param int $options
848
+ * @param bool $descending
849
+ * @return static
850
+ */
851
+ public function sortBy($callback, $options = SORT_REGULAR, $descending = false);
852
+
853
+ /**
854
+ * Sort the collection in descending order using the given callback.
855
+ *
856
+ * @param callable|string $callback
857
+ * @param int $options
858
+ * @return static
859
+ */
860
+ public function sortByDesc($callback, $options = SORT_REGULAR);
861
+
862
+ /**
863
+ * Sort the collection keys.
864
+ *
865
+ * @param int $options
866
+ * @param bool $descending
867
+ * @return static
868
+ */
869
+ public function sortKeys($options = SORT_REGULAR, $descending = false);
870
+
871
+ /**
872
+ * Sort the collection keys in descending order.
873
+ *
874
+ * @param int $options
875
+ * @return static
876
+ */
877
+ public function sortKeysDesc($options = SORT_REGULAR);
878
+
879
+ /**
880
+ * Get the sum of the given values.
881
+ *
882
+ * @param callable|string|null $callback
883
+ * @return mixed
884
+ */
885
+ public function sum($callback = null);
886
+
887
+ /**
888
+ * Take the first or last {$limit} items.
889
+ *
890
+ * @param int $limit
891
+ * @return static
892
+ */
893
+ public function take($limit);
894
+
895
+ /**
896
+ * Take items in the collection until the given condition is met.
897
+ *
898
+ * @param mixed $value
899
+ * @return static
900
+ */
901
+ public function takeUntil($value);
902
+
903
+ /**
904
+ * Take items in the collection while the given condition is met.
905
+ *
906
+ * @param mixed $value
907
+ * @return static
908
+ */
909
+ public function takeWhile($value);
910
+
911
+ /**
912
+ * Pass the collection to the given callback and then return it.
913
+ *
914
+ * @param callable $callback
915
+ * @return $this
916
+ */
917
+ public function tap(callable $callback);
918
+
919
+ /**
920
+ * Pass the enumerable to the given callback and return the result.
921
+ *
922
+ * @param callable $callback
923
+ * @return mixed
924
+ */
925
+ public function pipe(callable $callback);
926
+
927
+ /**
928
+ * Get the values of a given key.
929
+ *
930
+ * @param string|array $value
931
+ * @param string|null $key
932
+ * @return static
933
+ */
934
+ public function pluck($value, $key = null);
935
+
936
+ /**
937
+ * Create a collection of all elements that do not pass a given truth test.
938
+ *
939
+ * @param callable|mixed $callback
940
+ * @return static
941
+ */
942
+ public function reject($callback = true);
943
+
944
+ /**
945
+ * Return only unique items from the collection array.
946
+ *
947
+ * @param string|callable|null $key
948
+ * @param bool $strict
949
+ * @return static
950
+ */
951
+ public function unique($key = null, $strict = false);
952
+
953
+ /**
954
+ * Return only unique items from the collection array using strict comparison.
955
+ *
956
+ * @param string|callable|null $key
957
+ * @return static
958
+ */
959
+ public function uniqueStrict($key = null);
960
+
961
+ /**
962
+ * Reset the keys on the underlying array.
963
+ *
964
+ * @return static
965
+ */
966
+ public function values();
967
+
968
+ /**
969
+ * Pad collection to the specified length with a value.
970
+ *
971
+ * @param int $size
972
+ * @param mixed $value
973
+ * @return static
974
+ */
975
+ public function pad($size, $value);
976
+
977
+ /**
978
+ * Count the number of items in the collection using a given truth test.
979
+ *
980
+ * @param callable|null $callback
981
+ * @return static
982
+ */
983
+ public function countBy($callback = null);
984
+
985
+ /**
986
+ * Zip the collection together with one or more arrays.
987
+ *
988
+ * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]);
989
+ * => [[1, 4], [2, 5], [3, 6]]
990
+ *
991
+ * @param mixed ...$items
992
+ * @return static
993
+ */
994
+ public function zip($items);
995
+
996
+ /**
997
+ * Collect the values into a collection.
998
+ *
999
+ * @return \Illuminate\Support\Collection
1000
+ */
1001
+ public function collect();
1002
+
1003
+ /**
1004
+ * Convert the collection to its string representation.
1005
+ *
1006
+ * @return string
1007
+ */
1008
+ public function __toString();
1009
+
1010
+ /**
1011
+ * Add a method to the list of proxied methods.
1012
+ *
1013
+ * @param string $method
1014
+ * @return void
1015
+ */
1016
+ public static function proxy($method);
1017
+
1018
+ /**
1019
+ * Dynamically access collection proxies.
1020
+ *
1021
+ * @param string $key
1022
+ * @return mixed
1023
+ *
1024
+ * @throws \Exception
1025
+ */
1026
+ public function __get($key);
1027
+ }
vendor/illuminate/{support → collections}/HigherOrderCollectionProxy.php RENAMED
@@ -3,14 +3,14 @@
3
  namespace Illuminate\Support;
4
 
5
  /**
6
- * @mixin \Illuminate\Support\Collection
7
  */
8
  class HigherOrderCollectionProxy
9
  {
10
  /**
11
  * The collection being operated on.
12
  *
13
- * @var \Illuminate\Support\Collection
14
  */
15
  protected $collection;
16
 
@@ -24,11 +24,11 @@ class HigherOrderCollectionProxy
24
  /**
25
  * Create a new proxy instance.
26
  *
27
- * @param \Illuminate\Support\Collection $collection
28
  * @param string $method
29
  * @return void
30
  */
31
- public function __construct(Collection $collection, $method)
32
  {
33
  $this->method = $method;
34
  $this->collection = $collection;
3
  namespace Illuminate\Support;
4
 
5
  /**
6
+ * @mixin \Illuminate\Support\Enumerable
7
  */
8
  class HigherOrderCollectionProxy
9
  {
10
  /**
11
  * The collection being operated on.
12
  *
13
+ * @var \Illuminate\Support\Enumerable
14
  */
15
  protected $collection;
16
 
24
  /**
25
  * Create a new proxy instance.
26
  *
27
+ * @param \Illuminate\Support\Enumerable $collection
28
  * @param string $method
29
  * @return void
30
  */
31
+ public function __construct(Enumerable $collection, $method)
32
  {
33
  $this->method = $method;
34
  $this->collection = $collection;
vendor/illuminate/collections/HigherOrderWhenProxy.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ /**
6
+ * @mixin \Illuminate\Support\Enumerable
7
+ */
8
+ class HigherOrderWhenProxy
9
+ {
10
+ /**
11
+ * The collection being operated on.
12
+ *
13
+ * @var \Illuminate\Support\Enumerable
14
+ */
15
+ protected $collection;
16
+
17
+ /**
18
+ * The condition for proxying.
19
+ *
20
+ * @var bool
21
+ */
22
+ protected $condition;
23
+
24
+ /**
25
+ * Create a new proxy instance.
26
+ *
27
+ * @param \Illuminate\Support\Enumerable $collection
28
+ * @param bool $condition
29
+ * @return void
30
+ */
31
+ public function __construct(Enumerable $collection, $condition)
32
+ {
33
+ $this->condition = $condition;
34
+ $this->collection = $collection;
35
+ }
36
+
37
+ /**
38
+ * Proxy accessing an attribute onto the collection.
39
+ *
40
+ * @param string $key
41
+ * @return mixed
42
+ */
43
+ public function __get($key)
44
+ {
45
+ return $this->condition
46
+ ? $this->collection->{$key}
47
+ : $this->collection;
48
+ }
49
+
50
+ /**
51
+ * Proxy a method call onto the collection.
52
+ *
53
+ * @param string $method
54
+ * @param array $parameters
55
+ * @return mixed
56
+ */
57
+ public function __call($method, $parameters)
58
+ {
59
+ return $this->condition
60
+ ? $this->collection->{$method}(...$parameters)
61
+ : $this->collection;
62
+ }
63
+ }
vendor/{paragonie/random_compat/LICENSE → illuminate/collections/LICENSE.md} RENAMED
@@ -1,6 +1,6 @@
1
  The MIT License (MIT)
2
 
3
- Copyright (c) 2015 Paragon Initiative Enterprises
4
 
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
  of this software and associated documentation files (the "Software"), to deal
@@ -9,14 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
  copies of the Software, and to permit persons to whom the Software is
10
  furnished to do so, subject to the following conditions:
11
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
 
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
1
  The MIT License (MIT)
2
 
3
+ Copyright (c) Taylor Otwell
4
 
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
  of this software and associated documentation files (the "Software"), to deal
9
  copies of the Software, and to permit persons to whom the Software is
10
  furnished to do so, subject to the following conditions:
11
 
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
 
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
 
vendor/illuminate/collections/LazyCollection.php ADDED
@@ -0,0 +1,1417 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use ArrayIterator;
6
+ use Closure;
7
+ use DateTimeInterface;
8
+ use Illuminate\Support\Traits\EnumeratesValues;
9
+ use Illuminate\Support\Traits\Macroable;
10
+ use IteratorAggregate;
11
+ use stdClass;
12
+
13
+ class LazyCollection implements Enumerable
14
+ {
15
+ use EnumeratesValues, Macroable;
16
+
17
+ /**
18
+ * The source from which to generate items.
19
+ *
20
+ * @var callable|static
21
+ */
22
+ public $source;
23
+
24
+ /**
25
+ * Create a new lazy collection instance.
26
+ *
27
+ * @param mixed $source
28
+ * @return void
29
+ */
30
+ public function __construct($source = null)
31
+ {
32
+ if ($source instanceof Closure || $source instanceof self) {
33
+ $this->source = $source;
34
+ } elseif (is_null($source)) {
35
+ $this->source = static::empty();
36
+ } else {
37
+ $this->source = $this->getArrayableItems($source);
38
+ }
39
+ }
40
+
41
+ /**
42
+ * Create a collection with the given range.
43
+ *
44
+ * @param int $from
45
+ * @param int $to
46
+ * @return static
47
+ */
48
+ public static function range($from, $to)
49
+ {
50
+ return new static(function () use ($from, $to) {
51
+ if ($from <= $to) {
52
+ for (; $from <= $to; $from++) {
53
+ yield $from;
54
+ }
55
+ } else {
56
+ for (; $from >= $to; $from--) {
57
+ yield $from;
58
+ }
59
+ }
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Get all items in the enumerable.
65
+ *
66
+ * @return array
67
+ */
68
+ public function all()
69
+ {
70
+ if (is_array($this->source)) {
71
+ return $this->source;
72
+ }
73
+
74
+ return iterator_to_array($this->getIterator());
75
+ }
76
+
77
+ /**
78
+ * Eager load all items into a new lazy collection backed by an array.
79
+ *
80
+ * @return static
81
+ */
82
+ public function eager()
83
+ {
84
+ return new static($this->all());
85
+ }
86
+
87
+ /**
88
+ * Cache values as they're enumerated.
89
+ *
90
+ * @return static
91
+ */
92
+ public function remember()
93
+ {
94
+ $iterator = $this->getIterator();
95
+
96
+ $iteratorIndex = 0;
97
+
98
+ $cache = [];
99
+
100
+ return new static(function () use ($iterator, &$iteratorIndex, &$cache) {
101
+ for ($index = 0; true; $index++) {
102
+ if (array_key_exists($index, $cache)) {
103
+ yield $cache[$index][0] => $cache[$index][1];
104
+
105
+ continue;
106
+ }
107
+
108
+ if ($iteratorIndex < $index) {
109
+ $iterator->next();
110
+
111
+ $iteratorIndex++;
112
+ }
113
+
114
+ if (! $iterator->valid()) {
115
+ break;
116
+ }
117
+
118
+ $cache[$index] = [$iterator->key(), $iterator->current()];
119
+
120
+ yield $cache[$index][0] => $cache[$index][1];
121
+ }
122
+ });
123
+ }
124
+
125
+ /**
126
+ * Get the average value of a given key.
127
+ *
128
+ * @param callable|string|null $callback
129
+ * @return mixed
130
+ */
131
+ public function avg($callback = null)
132
+ {
133
+ return $this->collect()->avg($callback);
134
+ }
135
+
136
+ /**
137
+ * Get the median of a given key.
138
+ *
139
+ * @param string|array|null $key
140
+ * @return mixed
141
+ */
142
+ public function median($key = null)
143
+ {
144
+ return $this->collect()->median($key);
145
+ }
146
+
147
+ /**
148
+ * Get the mode of a given key.
149
+ *
150
+ * @param string|array|null $key
151
+ * @return array|null
152
+ */
153
+ public function mode($key = null)
154
+ {
155
+ return $this->collect()->mode($key);
156
+ }
157
+
158
+ /**
159
+ * Collapse the collection of items into a single array.
160
+ *
161
+ * @return static
162
+ */
163
+ public function collapse()
164
+ {
165
+ return new static(function () {
166
+ foreach ($this as $values) {
167
+ if (is_array($values) || $values instanceof Enumerable) {
168
+ foreach ($values as $value) {
169
+ yield $value;
170
+ }
171
+ }
172
+ }
173
+ });
174
+ }
175
+
176
+ /**
177
+ * Determine if an item exists in the enumerable.
178
+ *
179
+ * @param mixed $key
180
+ * @param mixed $operator
181
+ * @param mixed $value
182
+ * @return bool
183
+ */
184
+ public function contains($key, $operator = null, $value = null)
185
+ {
186
+ if (func_num_args() === 1 && $this->useAsCallable($key)) {
187
+ $placeholder = new stdClass;
188
+
189
+ return $this->first($key, $placeholder) !== $placeholder;
190
+ }
191
+
192
+ if (func_num_args() === 1) {
193
+ $needle = $key;
194
+
195
+ foreach ($this as $value) {
196
+ if ($value == $needle) {
197
+ return true;
198
+ }
199
+ }
200
+
201
+ return false;
202
+ }
203
+
204
+ return $this->contains($this->operatorForWhere(...func_get_args()));
205
+ }
206
+
207
+ /**
208
+ * Cross join the given iterables, returning all possible permutations.
209
+ *
210
+ * @param array ...$arrays
211
+ * @return static
212
+ */
213
+ public function crossJoin(...$arrays)
214
+ {
215
+ return $this->passthru('crossJoin', func_get_args());
216
+ }
217
+
218
+ /**
219
+ * Count the number of items in the collection by a field or using a callback.
220
+ *
221
+ * @param callable|string $countBy
222
+ * @return static
223
+ */
224
+ public function countBy($countBy = null)
225
+ {
226
+ $countBy = is_null($countBy)
227
+ ? $this->identity()
228
+ : $this->valueRetriever($countBy);
229
+
230
+ return new static(function () use ($countBy) {
231
+ $counts = [];
232
+
233
+ foreach ($this as $key => $value) {
234
+ $group = $countBy($value, $key);
235
+
236
+ if (empty($counts[$group])) {
237
+ $counts[$group] = 0;
238
+ }
239
+
240
+ $counts[$group]++;
241
+ }
242
+
243
+ yield from $counts;
244
+ });
245
+ }
246
+
247
+ /**
248
+ * Get the items that are not present in the given items.
249
+ *
250
+ * @param mixed $items
251
+ * @return static
252
+ */
253
+ public function diff($items)
254
+ {
255
+ return $this->passthru('diff', func_get_args());
256
+ }
257
+
258
+ /**
259
+ * Get the items that are not present in the given items, using the callback.
260
+ *
261
+ * @param mixed $items
262
+ * @param callable $callback
263
+ * @return static
264
+ */
265
+ public function diffUsing($items, callable $callback)
266
+ {
267
+ return $this->passthru('diffUsing', func_get_args());
268
+ }
269
+
270
+ /**
271
+ * Get the items whose keys and values are not present in the given items.
272
+ *
273
+ * @param mixed $items
274
+ * @return static
275
+ */
276
+ public function diffAssoc($items)
277
+ {
278
+ return $this->passthru('diffAssoc', func_get_args());
279
+ }
280
+
281
+ /**
282
+ * Get the items whose keys and values are not present in the given items, using the callback.
283
+ *
284
+ * @param mixed $items
285
+ * @param callable $callback
286
+ * @return static
287
+ */
288
+ public function diffAssocUsing($items, callable $callback)
289
+ {
290
+ return $this->passthru('diffAssocUsing', func_get_args());
291
+ }
292
+
293
+ /**
294
+ * Get the items whose keys are not present in the given items.
295
+ *
296
+ * @param mixed $items
297
+ * @return static
298
+ */
299
+ public function diffKeys($items)
300
+ {
301
+ return $this->passthru('diffKeys', func_get_args());
302
+ }
303
+
304
+ /**
305
+ * Get the items whose keys are not present in the given items, using the callback.
306
+ *
307
+ * @param mixed $items
308
+ * @param callable $callback
309
+ * @return static
310
+ */
311
+ public function diffKeysUsing($items, callable $callback)
312
+ {
313
+ return $this->passthru('diffKeysUsing', func_get_args());
314
+ }
315
+
316
+ /**
317
+ * Retrieve duplicate items.
318
+ *
319
+ * @param callable|null $callback
320
+ * @param bool $strict
321
+ * @return static
322
+ */
323
+ public function duplicates($callback = null, $strict = false)
324
+ {
325
+ return $this->passthru('duplicates', func_get_args());
326
+ }
327
+
328
+ /**
329
+ * Retrieve duplicate items using strict comparison.
330
+ *
331
+ * @param callable|null $callback
332
+ * @return static
333
+ */
334
+ public function duplicatesStrict($callback = null)
335
+ {
336
+ return $this->passthru('duplicatesStrict', func_get_args());
337
+ }
338
+
339
+ /**
340
+ * Get all items except for those with the specified keys.
341
+ *
342
+ * @param mixed $keys
343
+ * @return static
344
+ */
345
+ public function except($keys)
346
+ {
347
+ return $this->passthru('except', func_get_args());
348
+ }
349
+
350
+ /**
351
+ * Run a filter over each of the items.
352
+ *
353
+ * @param callable|null $callback
354
+ * @return static
355
+ */
356
+ public function filter(callable $callback = null)
357
+ {
358
+ if (is_null($callback)) {
359
+ $callback = function ($value) {
360
+ return (bool) $value;
361
+ };
362
+ }
363
+
364
+ return new static(function () use ($callback) {
365
+ foreach ($this as $key => $value) {
366
+ if ($callback($value, $key)) {
367
+ yield $key => $value;
368
+ }
369
+ }
370
+ });
371
+ }
372
+
373
+ /**
374
+ * Get the first item from the enumerable passing the given truth test.
375
+ *
376
+ * @param callable|null $callback
377
+ * @param mixed $default
378
+ * @return mixed
379
+ */
380
+ public function first(callable $callback = null, $default = null)
381
+ {
382
+ $iterator = $this->getIterator();
383
+
384
+ if (is_null($callback)) {
385
+ if (! $iterator->valid()) {
386
+ return value($default);
387
+ }
388
+
389
+ return $iterator->current();
390
+ }
391
+
392
+ foreach ($iterator as $key => $value) {
393
+ if ($callback($value, $key)) {
394
+ return $value;
395
+ }
396
+ }
397
+
398
+ return value($default);
399
+ }
400
+
401
+ /**
402
+ * Get a flattened list of the items in the collection.
403
+ *
404
+ * @param int $depth
405
+ * @return static
406
+ */
407
+ public function flatten($depth = INF)
408
+ {
409
+ $instance = new static(function () use ($depth) {
410
+ foreach ($this as $item) {
411
+ if (! is_array($item) && ! $item instanceof Enumerable) {
412
+ yield $item;
413
+ } elseif ($depth === 1) {
414
+ yield from $item;
415
+ } else {
416
+ yield from (new static($item))->flatten($depth - 1);
417
+ }
418
+ }
419
+ });
420
+
421
+ return $instance->values();
422
+ }
423
+
424
+ /**
425
+ * Flip the items in the collection.
426
+ *
427
+ * @return static
428
+ */
429
+ public function flip()
430
+ {
431
+ return new static(function () {
432
+ foreach ($this as $key => $value) {
433
+ yield $value => $key;
434
+ }
435
+ });
436
+ }
437
+
438
+ /**
439
+ * Get an item by key.
440
+ *
441
+ * @param mixed $key
442
+ * @param mixed $default
443
+ * @return mixed
444
+ */
445
+ public function get($key, $default = null)
446
+ {
447
+ if (is_null($key)) {
448
+ return;
449
+ }
450
+
451
+ foreach ($this as $outerKey => $outerValue) {
452
+ if ($outerKey == $key) {
453
+ return $outerValue;
454
+ }
455
+ }
456
+
457
+ return value($default);
458
+ }
459
+
460
+ /**
461
+ * Group an associative array by a field or using a callback.
462
+ *
463
+ * @param array|callable|string $groupBy
464
+ * @param bool $preserveKeys
465
+ * @return static
466
+ */
467
+ public function groupBy($groupBy, $preserveKeys = false)
468
+ {
469
+ return $this->passthru('groupBy', func_get_args());
470
+ }
471
+
472
+ /**
473
+ * Key an associative array by a field or using a callback.
474
+ *
475
+ * @param callable|string $keyBy
476
+ * @return static
477
+ */
478
+ public function keyBy($keyBy)
479
+ {
480
+ return new static(function () use ($keyBy) {
481
+ $keyBy = $this->valueRetriever($keyBy);
482
+
483
+ foreach ($this as $key => $item) {
484
+ $resolvedKey = $keyBy($item, $key);
485
+
486
+ if (is_object($resolvedKey)) {
487
+ $resolvedKey = (string) $resolvedKey;
488
+ }
489
+
490
+ yield $resolvedKey => $item;
491
+ }
492
+ });
493
+ }
494
+
495
+ /**
496
+ * Determine if an item exists in the collection by key.
497
+ *
498
+ * @param mixed $key
499
+ * @return bool
500
+ */
501
+ public function has($key)
502
+ {
503
+ $keys = array_flip(is_array($key) ? $key : func_get_args());
504
+ $count = count($keys);
505
+
506
+ foreach ($this as $key => $value) {
507
+ if (array_key_exists($key, $keys) && --$count == 0) {
508
+ return true;
509
+ }
510
+ }
511
+
512
+ return false;
513
+ }
514
+
515
+ /**
516
+ * Concatenate values of a given key as a string.
517
+ *
518
+ * @param string $value
519
+ * @param string|null $glue
520
+ * @return string
521
+ */
522
+ public function implode($value, $glue = null)
523
+ {
524
+ return $this->collect()->implode(...func_get_args());
525
+ }
526
+
527
+ /**
528
+ * Intersect the collection with the given items.
529
+ *
530
+ * @param mixed $items
531
+ * @return static
532
+ */
533
+ public function intersect($items)
534
+ {
535
+ return $this->passthru('intersect', func_get_args());
536
+ }
537
+
538
+ /**
539
+ * Intersect the collection with the given items by key.
540
+ *
541
+ * @param mixed $items
542
+ * @return static
543
+ */
544
+ public function intersectByKeys($items)
545
+ {
546
+ return $this->passthru('intersectByKeys', func_get_args());
547
+ }
548
+
549
+ /**
550
+ * Determine if the items are empty or not.
551
+ *
552
+ * @return bool
553
+ */
554
+ public function isEmpty()
555
+ {
556
+ return ! $this->getIterator()->valid();
557
+ }
558
+
559
+ /**
560
+ * Determine if the collection contains a single item.
561
+ *
562
+ * @return bool
563
+ */
564
+ public function containsOneItem()
565
+ {
566
+ return $this->take(2)->count() === 1;
567
+ }
568
+
569
+ /**
570
+ * Join all items from the collection using a string. The final items can use a separate glue string.
571
+ *
572
+ * @param string $glue
573
+ * @param string $finalGlue
574
+ * @return string
575
+ */
576
+ public function join($glue, $finalGlue = '')
577
+ {
578
+ return $this->collect()->join(...func_get_args());
579
+ }
580
+
581
+ /**
582
+ * Get the keys of the collection items.
583
+ *
584
+ * @return static
585
+ */
586
+ public function keys()
587
+ {
588
+ return new static(function () {
589
+ foreach ($this as $key => $value) {
590
+ yield $key;
591
+ }
592
+ });
593
+ }
594
+
595
+ /**
596
+ * Get the last item from the collection.
597
+ *
598
+ * @param callable|null $callback
599
+ * @param mixed $default
600
+ * @return mixed
601
+ */
602
+ public function last(callable $callback = null, $default = null)
603
+ {
604
+ $needle = $placeholder = new stdClass;
605
+
606
+ foreach ($this as $key => $value) {
607
+ if (is_null($callback) || $callback($value, $key)) {
608
+ $needle = $value;
609
+ }
610
+ }
611
+
612
+ return $needle === $placeholder ? value($default) : $needle;
613
+ }
614
+
615
+ /**
616
+ * Get the values of a given key.
617
+ *
618
+ * @param string|array $value
619
+ * @param string|null $key
620
+ * @return static
621
+ */
622
+ public function pluck($value, $key = null)
623
+ {
624
+ return new static(function () use ($value, $key) {
625
+ [$value, $key] = $this->explodePluckParameters($value, $key);
626
+
627
+ foreach ($this as $item) {
628
+ $itemValue = data_get($item, $value);
629
+
630
+ if (is_null($key)) {
631
+ yield $itemValue;
632
+ } else {
633
+ $itemKey = data_get($item, $key);
634
+
635
+ if (is_object($itemKey) && method_exists($itemKey, '__toString')) {
636
+ $itemKey = (string) $itemKey;
637
+ }
638
+
639
+ yield $itemKey => $itemValue;
640
+ }
641
+ }
642
+ });
643
+ }
644
+
645
+ /**
646
+ * Run a map over each of the items.
647
+ *
648
+ * @param callable $callback
649
+ * @return static
650
+ */
651
+ public function map(callable $callback)
652
+ {
653
+ return new static(function () use ($callback) {
654
+ foreach ($this as $key => $value) {
655
+ yield $key => $callback($value, $key);
656
+ }
657
+ });
658
+ }
659
+
660
+ /**
661
+ * Run a dictionary map over the items.
662
+ *
663
+ * The callback should return an associative array with a single key/value pair.
664
+ *
665
+ * @param callable $callback
666
+ * @return static
667
+ */
668
+ public function mapToDictionary(callable $callback)
669
+ {
670
+ return $this->passthru('mapToDictionary', func_get_args());
671
+ }
672
+
673
+ /**
674
+ * Run an associative map over each of the items.
675
+ *
676
+ * The callback should return an associative array with a single key/value pair.
677
+ *
678
+ * @param callable $callback
679
+ * @return static
680
+ */
681
+ public function mapWithKeys(callable $callback)
682
+ {
683
+ return new static(function () use ($callback) {
684
+ foreach ($this as $key => $value) {
685
+ yield from $callback($value, $key);
686
+ }
687
+ });
688
+ }
689
+
690
+ /**
691
+ * Merge the collection with the given items.
692
+ *
693
+ * @param mixed $items
694
+ * @return static
695
+ */
696
+ public function merge($items)
697
+ {
698
+ return $this->passthru('merge', func_get_args());
699
+ }
700
+
701
+ /**
702
+ * Recursively merge the collection with the given items.
703
+ *
704
+ * @param mixed $items
705
+ * @return static
706
+ */
707
+ public function mergeRecursive($items)
708
+ {
709
+ return $this->passthru('mergeRecursive', func_get_args());
710
+ }
711
+
712
+ /**
713
+ * Create a collection by using this collection for keys and another for its values.
714
+ *
715
+ * @param mixed $values
716
+ * @return static
717
+ */
718
+ public function combine($values)
719
+ {
720
+ return new static(function () use ($values) {
721
+ $values = $this->makeIterator($values);
722
+
723
+ $errorMessage = 'Both parameters should have an equal number of elements';
724
+
725
+ foreach ($this as $key) {
726
+ if (! $values->valid()) {
727
+ trigger_error($errorMessage, E_USER_WARNING);
728
+
729
+ break;
730
+ }
731
+
732
+ yield $key => $values->current();
733
+
734
+ $values->next();
735
+ }
736
+
737
+ if ($values->valid()) {
738
+ trigger_error($errorMessage, E_USER_WARNING);
739
+ }
740
+ });
741
+ }
742
+
743
+ /**
744
+ * Union the collection with the given items.
745
+ *
746
+ * @param mixed $items
747
+ * @return static
748
+ */
749
+ public function union($items)
750
+ {
751
+ return $this->passthru('union', func_get_args());
752
+ }
753
+
754
+ /**
755
+ * Create a new collection consisting of every n-th element.
756
+ *
757
+ * @param int $step
758
+ * @param int $offset
759
+ * @return static
760
+ */
761
+ public function nth($step, $offset = 0)
762
+ {
763
+ return new static(function () use ($step, $offset) {
764
+ $position = 0;
765
+
766
+ foreach ($this as $item) {
767
+ if ($position % $step === $offset) {
768
+ yield $item;
769
+ }
770
+
771
+ $position++;
772
+ }
773
+ });
774
+ }
775
+
776
+ /**
777
+ * Get the items with the specified keys.
778
+ *
779
+ * @param mixed $keys
780
+ * @return static
781
+ */
782
+ public function only($keys)
783
+ {
784
+ if ($keys instanceof Enumerable) {
785
+ $keys = $keys->all();
786
+ } elseif (! is_null($keys)) {
787
+ $keys = is_array($keys) ? $keys : func_get_args();
788
+ }
789
+
790
+ return new static(function () use ($keys) {
791
+ if (is_null($keys)) {
792
+ yield from $this;
793
+ } else {
794
+ $keys = array_flip($keys);
795
+
796
+ foreach ($this as $key => $value) {
797
+ if (array_key_exists($key, $keys)) {
798
+ yield $key => $value;
799
+
800
+ unset($keys[$key]);
801
+
802
+ if (empty($keys)) {
803
+ break;
804
+ }
805
+ }
806
+ }
807
+ }
808
+ });
809
+ }
810
+
811
+ /**
812
+ * Push all of the given items onto the collection.
813
+ *
814
+ * @param iterable $source
815
+ * @return static
816
+ */
817
+ public function concat($source)
818
+ {
819
+ return (new static(function () use ($source) {
820
+ yield from $this;
821
+ yield from $source;
822
+ }))->values();
823
+ }
824
+
825
+ /**
826
+ * Get one or a specified number of items randomly from the collection.
827
+ *
828
+ * @param int|null $number
829
+ * @return static|mixed
830
+ *
831
+ * @throws \InvalidArgumentException
832
+ */
833
+ public function random($number = null)
834
+ {
835
+ $result = $this->collect()->random(...func_get_args());
836
+
837
+ return is_null($number) ? $result : new static($result);
838
+ }
839
+
840
+ /**
841
+ * Replace the collection items with the given items.
842
+ *
843
+ * @param mixed $items
844
+ * @return static
845
+ */
846
+ public function replace($items)
847
+ {
848
+ return new static(function () use ($items) {
849
+ $items = $this->getArrayableItems($items);
850
+
851
+ foreach ($this as $key => $value) {
852
+ if (array_key_exists($key, $items)) {
853
+ yield $key => $items[$key];
854
+
855
+ unset($items[$key]);
856
+ } else {
857
+ yield $key => $value;
858
+ }
859
+ }
860
+
861
+ foreach ($items as $key => $value) {
862
+ yield $key => $value;
863
+ }
864
+ });
865
+ }
866
+
867
+ /**
868
+ * Recursively replace the collection items with the given items.
869
+ *
870
+ * @param mixed $items
871
+ * @return static
872
+ */
873
+ public function replaceRecursive($items)
874
+ {
875
+ return $this->passthru('replaceRecursive', func_get_args());
876
+ }
877
+
878
+ /**
879
+ * Reverse items order.
880
+ *
881
+ * @return static
882
+ */
883
+ public function reverse()
884
+ {
885
+ return $this->passthru('reverse', func_get_args());
886
+ }
887
+
888
+ /**
889
+ * Search the collection for a given value and return the corresponding key if successful.
890
+ *
891
+ * @param mixed $value
892
+ * @param bool $strict
893
+ * @return mixed
894
+ */
895
+ public function search($value, $strict = false)
896
+ {
897
+ $predicate = $this->useAsCallable($value)
898
+ ? $value
899
+ : function ($item) use ($value, $strict) {
900
+ return $strict ? $item === $value : $item == $value;
901
+ };
902
+
903
+ foreach ($this as $key => $item) {
904
+ if ($predicate($item, $key)) {
905
+ return $key;
906
+ }
907
+ }
908
+
909
+ return false;
910
+ }
911
+
912
+ /**
913
+ * Shuffle the items in the collection.
914
+ *
915
+ * @param int|null $seed
916
+ * @return static
917
+ */
918
+ public function shuffle($seed = null)
919
+ {
920
+ return $this->passthru('shuffle', func_get_args());
921
+ }
922
+
923
+ /**
924
+ * Skip the first {$count} items.
925
+ *
926
+ * @param int $count
927
+ * @return static
928
+ */
929
+ public function skip($count)
930
+ {
931
+ return new static(function () use ($count) {
932
+ $iterator = $this->getIterator();
933
+
934
+ while ($iterator->valid() && $count--) {
935
+ $iterator->next();
936
+ }
937
+
938
+ while ($iterator->valid()) {
939
+ yield $iterator->key() => $iterator->current();
940
+
941
+ $iterator->next();
942
+ }
943
+ });
944
+ }
945
+
946
+ /**
947
+ * Skip items in the collection until the given condition is met.
948
+ *
949
+ * @param mixed $value
950
+ * @return static
951
+ */
952
+ public function skipUntil($value)
953
+ {
954
+ $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
955
+
956
+ return $this->skipWhile($this->negate($callback));
957
+ }
958
+
959
+ /**
960
+ * Skip items in the collection while the given condition is met.
961
+ *
962
+ * @param mixed $value
963
+ * @return static
964
+ */
965
+ public function skipWhile($value)
966
+ {
967
+ $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
968
+
969
+ return new static(function () use ($callback) {
970
+ $iterator = $this->getIterator();
971
+
972
+ while ($iterator->valid() && $callback($iterator->current(), $iterator->key())) {
973
+ $iterator->next();
974
+ }
975
+
976
+ while ($iterator->valid()) {
977
+ yield $iterator->key() => $iterator->current();
978
+
979
+ $iterator->next();
980
+ }
981
+ });
982
+ }
983
+
984
+ /**
985
+ * Get a slice of items from the enumerable.
986
+ *
987
+ * @param int $offset
988
+ * @param int|null $length
989
+ * @return static
990
+ */
991
+ public function slice($offset, $length = null)
992
+ {
993
+ if ($offset < 0 || $length < 0) {
994
+ return $this->passthru('slice', func_get_args());
995
+ }
996
+
997
+ $instance = $this->skip($offset);
998
+
999
+ return is_null($length) ? $instance : $instance->take($length);
1000
+ }
1001
+
1002
+ /**
1003
+ * Split a collection into a certain number of groups.
1004
+ *
1005
+ * @param int $numberOfGroups
1006
+ * @return static
1007
+ */
1008
+ public function split($numberOfGroups)
1009
+ {
1010
+ return $this->passthru('split', func_get_args());
1011
+ }
1012
+
1013
+ /**
1014
+ * Chunk the collection into chunks of the given size.
1015
+ *
1016
+ * @param int $size
1017
+ * @return static
1018
+ */
1019
+ public function chunk($size)
1020
+ {
1021
+ if ($size <= 0) {
1022
+ return static::empty();
1023
+ }
1024
+
1025
+ return new static(function () use ($size) {
1026
+ $iterator = $this->getIterator();
1027
+
1028
+ while ($iterator->valid()) {
1029
+ $chunk = [];
1030
+
1031
+ while (true) {
1032
+ $chunk[$iterator->key()] = $iterator->current();
1033
+
1034
+ if (count($chunk) < $size) {
1035
+ $iterator->next();
1036
+
1037
+ if (! $iterator->valid()) {
1038
+ break;
1039
+ }
1040
+ } else {
1041
+ break;
1042
+ }
1043
+ }
1044
+
1045
+ yield new static($chunk);
1046
+
1047
+ $iterator->next();
1048
+ }
1049
+ });
1050
+ }
1051
+
1052
+ /**
1053
+ * Split a collection into a certain number of groups, and fill the first groups completely.
1054
+ *
1055
+ * @param int $numberOfGroups
1056
+ * @return static
1057
+ */
1058
+ public function splitIn($numberOfGroups)
1059
+ {
1060
+ return $this->chunk(ceil($this->count() / $numberOfGroups));
1061
+ }
1062
+
1063
+ /**
1064
+ * Chunk the collection into chunks with a callback.
1065
+ *
1066
+ * @param callable $callback
1067
+ * @return static
1068
+ */
1069
+ public function chunkWhile(callable $callback)
1070
+ {
1071
+ return new static(function () use ($callback) {
1072
+ $iterator = $this->getIterator();
1073
+
1074
+ $chunk = new Collection;
1075
+
1076
+ if ($iterator->valid()) {
1077
+ $chunk[$iterator->key()] = $iterator->current();
1078
+
1079
+ $iterator->next();
1080
+ }
1081
+
1082
+ while ($iterator->valid()) {
1083
+ if (! $callback($iterator->current(), $iterator->key(), $chunk)) {
1084
+ yield new static($chunk);
1085
+
1086
+ $chunk = new Collection;
1087
+ }
1088
+
1089
+ $chunk[$iterator->key()] = $iterator->current();
1090
+
1091
+ $iterator->next();
1092
+ }
1093
+
1094
+ if ($chunk->isNotEmpty()) {
1095
+ yield new static($chunk);
1096
+ }
1097
+ });
1098
+ }
1099
+
1100
+ /**
1101
+ * Sort through each item with a callback.
1102
+ *
1103
+ * @param callable|null|int $callback
1104
+ * @return static
1105
+ */
1106
+ public function sort($callback = null)
1107
+ {
1108
+ return $this->passthru('sort', func_get_args());
1109
+ }
1110
+
1111
+ /**
1112
+ * Sort items in descending order.
1113
+ *
1114
+ * @param int $options
1115
+ * @return static
1116
+ */
1117
+ public function sortDesc($options = SORT_REGULAR)
1118
+ {
1119
+ return $this->passthru('sortDesc', func_get_args());
1120
+ }
1121
+
1122
+ /**
1123
+ * Sort the collection using the given callback.
1124
+ *
1125
+ * @param callable|string $callback
1126
+ * @param int $options
1127
+ * @param bool $descending
1128
+ * @return static
1129
+ */
1130
+ public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
1131
+ {
1132
+ return $this->passthru('sortBy', func_get_args());
1133
+ }
1134
+
1135
+ /**
1136
+ * Sort the collection in descending order using the given callback.
1137
+ *
1138
+ * @param callable|string $callback
1139
+ * @param int $options
1140
+ * @return static
1141
+ */
1142
+ public function sortByDesc($callback, $options = SORT_REGULAR)
1143
+ {
1144
+ return $this->passthru('sortByDesc', func_get_args());
1145
+ }
1146
+
1147
+ /**
1148
+ * Sort the collection keys.
1149
+ *
1150
+ * @param int $options
1151
+ * @param bool $descending
1152
+ * @return static
1153
+ */
1154
+ public function sortKeys($options = SORT_REGULAR, $descending = false)
1155
+ {
1156
+ return $this->passthru('sortKeys', func_get_args());
1157
+ }
1158
+
1159
+ /**
1160
+ * Sort the collection keys in descending order.
1161
+ *
1162
+ * @param int $options
1163
+ * @return static
1164
+ */
1165
+ public function sortKeysDesc($options = SORT_REGULAR)
1166
+ {
1167
+ return $this->passthru('sortKeysDesc', func_get_args());
1168
+ }
1169
+
1170
+ /**
1171
+ * Take the first or last {$limit} items.
1172
+ *
1173
+ * @param int $limit
1174
+ * @return static
1175
+ */
1176
+ public function take($limit)
1177
+ {
1178
+ if ($limit < 0) {
1179
+ return $this->passthru('take', func_get_args());
1180
+ }
1181
+
1182
+ return new static(function () use ($limit) {
1183
+ $iterator = $this->getIterator();
1184
+
1185
+ while ($limit--) {
1186
+ if (! $iterator->valid()) {
1187
+ break;
1188
+ }
1189
+
1190
+ yield $iterator->key() => $iterator->current();
1191
+
1192
+ if ($limit) {
1193
+ $iterator->next();
1194
+ }
1195
+ }
1196
+ });
1197
+ }
1198
+
1199
+ /**
1200
+ * Take items in the collection until the given condition is met.
1201
+ *
1202
+ * @param mixed $value
1203
+ * @return static
1204
+ */
1205
+ public function takeUntil($value)
1206
+ {
1207
+ $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
1208
+
1209
+ return new static(function () use ($callback) {
1210
+ foreach ($this as $key => $item) {
1211
+ if ($callback($item, $key)) {
1212
+ break;
1213
+ }
1214
+
1215
+ yield $key => $item;
1216
+ }
1217
+ });
1218
+ }
1219
+
1220
+ /**
1221
+ * Take items in the collection until a given point in time.
1222
+ *
1223
+ * @param \DateTimeInterface $timeout
1224
+ * @return static
1225
+ */
1226
+ public function takeUntilTimeout(DateTimeInterface $timeout)
1227
+ {
1228
+ $timeout = $timeout->getTimestamp();
1229
+
1230
+ return $this->takeWhile(function () use ($timeout) {
1231
+ return $this->now() < $timeout;
1232
+ });
1233
+ }
1234
+
1235
+ /**
1236
+ * Take items in the collection while the given condition is met.
1237
+ *
1238
+ * @param mixed $value
1239
+ * @return static
1240
+ */
1241
+ public function takeWhile($value)
1242
+ {
1243
+ $callback = $this->useAsCallable($value) ? $value : $this->equality($value);
1244
+
1245
+ return $this->takeUntil(function ($item, $key) use ($callback) {
1246
+ return ! $callback($item, $key);
1247
+ });
1248
+ }
1249
+
1250
+ /**
1251
+ * Pass each item in the collection to the given callback, lazily.
1252
+ *
1253
+ * @param callable $callback
1254
+ * @return static
1255
+ */
1256
+ public function tapEach(callable $callback)
1257
+ {
1258
+ return new static(function () use ($callback) {
1259
+ foreach ($this as $key => $value) {
1260
+ $callback($value, $key);
1261
+
1262
+ yield $key => $value;
1263
+ }
1264
+ });
1265
+ }
1266
+
1267
+ /**
1268
+ * Reset the keys on the underlying array.
1269
+ *
1270
+ * @return static
1271
+ */
1272
+ public function values()
1273
+ {
1274
+ return new static(function () {
1275
+ foreach ($this as $item) {
1276
+ yield $item;
1277
+ }
1278
+ });
1279
+ }
1280
+
1281
+ /**
1282
+ * Zip the collection together with one or more arrays.
1283
+ *
1284
+ * e.g. new LazyCollection([1, 2, 3])->zip([4, 5, 6]);
1285
+ * => [[1, 4], [2, 5], [3, 6]]
1286
+ *
1287
+ * @param mixed ...$items
1288
+ * @return static
1289
+ */
1290
+ public function zip($items)
1291
+ {
1292
+ $iterables = func_get_args();
1293
+
1294
+ return new static(function () use ($iterables) {
1295
+ $iterators = Collection::make($iterables)->map(function ($iterable) {
1296
+ return $this->makeIterator($iterable);
1297
+ })->prepend($this->getIterator());
1298
+
1299
+ while ($iterators->contains->valid()) {
1300
+ yield new static($iterators->map->current());
1301
+
1302
+ $iterators->each->next();
1303
+ }
1304
+ });
1305
+ }
1306
+
1307
+ /**
1308
+ * Pad collection to the specified length with a value.
1309
+ *
1310
+ * @param int $size
1311
+ * @param mixed $value
1312
+ * @return static
1313
+ */
1314
+ public function pad($size, $value)
1315
+ {
1316
+ if ($size < 0) {
1317
+ return $this->passthru('pad', func_get_args());
1318
+ }
1319
+
1320
+ return new static(function () use ($size, $value) {
1321
+ $yielded = 0;
1322
+
1323
+ foreach ($this as $index => $item) {
1324
+ yield $index => $item;
1325
+
1326
+ $yielded++;
1327
+ }
1328
+
1329
+ while ($yielded++ < $size) {
1330
+ yield $value;
1331
+ }
1332
+ });
1333
+ }
1334
+
1335
+ /**
1336
+ * Get the values iterator.
1337
+ *
1338
+ * @return \Traversable
1339
+ */
1340
+ public function getIterator()
1341
+ {
1342
+ return $this->makeIterator($this->source);
1343
+ }
1344
+
1345
+ /**
1346
+ * Count the number of items in the collection.
1347
+ *
1348
+ * @return int
1349
+ */
1350
+ public function count()
1351
+ {
1352
+ if (is_array($this->source)) {
1353
+ return count($this->source);
1354
+ }
1355
+
1356
+ return iterator_count($this->getIterator());
1357
+ }
1358
+
1359
+ /**
1360
+ * Make an iterator from the given source.
1361
+ *
1362
+ * @param mixed $source
1363
+ * @return \Traversable
1364
+ */
1365
+ protected function makeIterator($source)
1366
+ {
1367
+ if ($source instanceof IteratorAggregate) {
1368
+ return $source->getIterator();
1369
+ }
1370
+
1371
+ if (is_array($source)) {
1372
+ return new ArrayIterator($source);
1373
+ }
1374
+
1375
+ return $source();
1376
+ }
1377
+
1378
+ /**
1379
+ * Explode the "value" and "key" arguments passed to "pluck".
1380
+ *
1381
+ * @param string|array $value
1382
+ * @param string|array|null $key
1383
+ * @return array
1384
+ */
1385
+ protected function explodePluckParameters($value, $key)
1386
+ {
1387
+ $value = is_string($value) ? explode('.', $value) : $value;
1388
+
1389
+ $key = is_null($key) || is_array($key) ? $key : explode('.', $key);
1390
+
1391
+ return [$value, $key];
1392
+ }
1393
+
1394
+ /**
1395
+ * Pass this lazy collection through a method on the collection class.
1396
+ *
1397
+ * @param string $method
1398
+ * @param array $params
1399
+ * @return static
1400
+ */
1401
+ protected function passthru($method, array $params)
1402
+ {
1403
+ return new static(function () use ($method, $params) {
1404
+ yield from $this->collect()->$method(...$params);
1405
+ });
1406
+ }
1407
+
1408
+ /**
1409
+ * Get the current time.
1410
+ *
1411
+ * @return int
1412
+ */
1413
+ protected function now()
1414
+ {
1415
+ return time();
1416
+ }
1417
+ }
vendor/illuminate/collections/Traits/EnumeratesValues.php ADDED
@@ -0,0 +1,1056 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Traits;
4
+
5
+ use CachingIterator;
6
+ use Closure;
7
+ use Exception;
8
+ use Illuminate\Contracts\Support\Arrayable;
9
+ use Illuminate\Contracts\Support\Jsonable;
10
+ use Illuminate\Support\Arr;
11
+ use Illuminate\Support\Collection;
12
+ use Illuminate\Support\Enumerable;
13
+ use Illuminate\Support\HigherOrderCollectionProxy;
14
+ use Illuminate\Support\HigherOrderWhenProxy;
15
+ use JsonSerializable;
16
+ use Symfony\Component\VarDumper\VarDumper;
17
+ use Traversable;
18
+
19
+ /**
20
+ * @property-read HigherOrderCollectionProxy $average
21
+ * @property-read HigherOrderCollectionProxy $avg
22
+ * @property-read HigherOrderCollectionProxy $contains
23
+ * @property-read HigherOrderCollectionProxy $each
24
+ * @property-read HigherOrderCollectionProxy $every
25
+ * @property-read HigherOrderCollectionProxy $filter
26
+ * @property-read HigherOrderCollectionProxy $first
27
+ * @property-read HigherOrderCollectionProxy $flatMap
28
+ * @property-read HigherOrderCollectionProxy $groupBy
29
+ * @property-read HigherOrderCollectionProxy $keyBy
30
+ * @property-read HigherOrderCollectionProxy $map
31
+ * @property-read HigherOrderCollectionProxy $max
32
+ * @property-read HigherOrderCollectionProxy $min
33
+ * @property-read HigherOrderCollectionProxy $partition
34
+ * @property-read HigherOrderCollectionProxy $reject
35
+ * @property-read HigherOrderCollectionProxy $some
36
+ * @property-read HigherOrderCollectionProxy $sortBy
37
+ * @property-read HigherOrderCollectionProxy $sortByDesc
38
+ * @property-read HigherOrderCollectionProxy $skipUntil
39
+ * @property-read HigherOrderCollectionProxy $skipWhile
40
+ * @property-read HigherOrderCollectionProxy $sum
41
+ * @property-read HigherOrderCollectionProxy $takeUntil
42
+ * @property-read HigherOrderCollectionProxy $takeWhile
43
+ * @property-read HigherOrderCollectionProxy $unique
44
+ * @property-read HigherOrderCollectionProxy $until
45
+ */
46
+ trait EnumeratesValues
47
+ {
48
+ /**
49
+ * The methods that can be proxied.
50
+ *
51
+ * @var string[]
52
+ */
53
+ protected static $proxies = [
54
+ 'average',
55
+ 'avg',
56
+ 'contains',
57
+ 'each',
58
+ 'every',
59
+ 'filter',
60
+ 'first',
61
+ 'flatMap',
62
+ 'groupBy',
63
+ 'keyBy',
64
+ 'map',
65
+ 'max',
66
+ 'min',
67
+ 'partition',
68
+ 'reject',
69
+ 'skipUntil',
70
+ 'skipWhile',
71
+ 'some',
72
+ 'sortBy',
73
+ 'sortByDesc',
74
+ 'sum',
75
+ 'takeUntil',
76
+ 'takeWhile',
77
+ 'unique',
78
+ 'until',
79
+ ];
80
+
81
+ /**
82
+ * Create a new collection instance if the value isn't one already.
83
+ *
84
+ * @param mixed $items
85
+ * @return static
86
+ */
87
+ public static function make($items = [])
88
+ {
89
+ return new static($items);
90
+ }
91
+
92
+ /**
93
+ * Wrap the given value in a collection if applicable.
94
+ *
95
+ * @param mixed $value
96
+ * @return static
97
+ */
98
+ public static function wrap($value)
99
+ {
100
+ return $value instanceof Enumerable
101
+ ? new static($value)
102
+ : new static(Arr::wrap($value));
103
+ }
104
+
105
+ /**
106
+ * Get the underlying items from the given collection if applicable.
107
+ *
108
+ * @param array|static $value
109
+ * @return array
110
+ */
111
+ public static function unwrap($value)
112
+ {
113
+ return $value instanceof Enumerable ? $value->all() : $value;
114
+ }
115
+
116
+ /**
117
+ * Create a new instance with no items.
118
+ *
119
+ * @return static
120
+ */
121
+ public static function empty()
122
+ {
123
+ return new static([]);
124
+ }
125
+
126
+ /**
127
+ * Create a new collection by invoking the callback a given amount of times.
128
+ *
129
+ * @param int $number
130
+ * @param callable|null $callback
131
+ * @return static
132
+ */
133
+ public static function times($number, callable $callback = null)
134
+ {
135
+ if ($number < 1) {
136
+ return new static;
137
+ }
138
+
139
+ return static::range(1, $number)
140
+ ->when($callback)
141
+ ->map($callback);
142
+ }
143
+
144
+ /**
145
+ * Alias for the "avg" method.
146
+ *
147
+ * @param callable|string|null $callback
148
+ * @return mixed
149
+ */
150
+ public function average($callback = null)
151
+ {
152
+ return $this->avg($callback);
153
+ }
154
+
155
+ /**
156
+ * Alias for the "contains" method.
157
+ *
158
+ * @param mixed $key
159
+ * @param mixed $operator
160
+ * @param mixed $value
161
+ * @return bool
162
+ */
163
+ public function some($key, $operator = null, $value = null)
164
+ {
165
+ return $this->contains(...func_get_args());
166
+ }
167
+
168
+ /**
169
+ * Determine if an item exists, using strict comparison.
170
+ *
171
+ * @param mixed $key
172
+ * @param mixed $value
173
+ * @return bool
174
+ */
175
+ public function containsStrict($key, $value = null)
176
+ {
177
+ if (func_num_args() === 2) {
178
+ return $this->contains(function ($item) use ($key, $value) {
179
+ return data_get($item, $key) === $value;
180
+ });
181
+ }
182
+
183
+ if ($this->useAsCallable($key)) {
184
+ return ! is_null($this->first($key));
185
+ }
186
+
187
+ foreach ($this as $item) {
188
+ if ($item === $key) {
189
+ return true;
190
+ }
191
+ }
192
+
193
+ return false;
194
+ }
195
+
196
+ /**
197
+ * Dump the items and end the script.
198
+ *
199
+ * @param mixed ...$args
200
+ * @return void
201
+ */
202
+ public function dd(...$args)
203
+ {
204
+ $this->dump(...$args);
205
+
206
+ exit(1);
207
+ }
208
+
209
+ /**
210
+ * Dump the items.
211
+ *
212
+ * @return $this
213
+ */
214
+ public function dump()
215
+ {
216
+ (new Collection(func_get_args()))
217
+ ->push($this->all())
218
+ ->each(function ($item) {
219
+ VarDumper::dump($item);
220
+ });
221
+
222
+ return $this;
223
+ }
224
+
225
+ /**
226
+ * Execute a callback over each item.
227
+ *
228
+ * @param callable $callback
229
+ * @return $this
230
+ */
231
+ public function each(callable $callback)
232
+ {
233
+ foreach ($this as $key => $item) {
234
+ if ($callback($item, $key) === false) {
235
+ break;
236
+ }
237
+ }
238
+
239
+ return $this;
240
+ }
241
+
242
+ /**
243
+ * Execute a callback over each nested chunk of items.
244
+ *
245
+ * @param callable $callback
246
+ * @return static
247
+ */
248
+ public function eachSpread(callable $callback)
249
+ {
250
+ return $this->each(function ($chunk, $key) use ($callback) {
251
+ $chunk[] = $key;
252
+
253
+ return $callback(...$chunk);
254
+ });
255
+ }
256
+
257
+ /**
258
+ * Determine if all items pass the given truth test.
259
+ *
260
+ * @param string|callable $key
261
+ * @param mixed $operator
262
+ * @param mixed $value
263
+ * @return bool
264
+ */
265
+ public function every($key, $operator = null, $value = null)
266
+ {
267
+ if (func_num_args() === 1) {
268
+ $callback = $this->valueRetriever($key);
269
+
270
+ foreach ($this as $k => $v) {
271
+ if (! $callback($v, $k)) {
272
+ return false;
273
+ }
274
+ }
275
+
276
+ return true;
277
+ }
278
+
279
+ return $this->every($this->operatorForWhere(...func_get_args()));
280
+ }
281
+
282
+ /**
283
+ * Get the first item by the given key value pair.
284
+ *
285
+ * @param string $key
286
+ * @param mixed $operator
287
+ * @param mixed $value
288
+ * @return mixed
289
+ */
290
+ public function firstWhere($key, $operator = null, $value = null)
291
+ {
292
+ return $this->first($this->operatorForWhere(...func_get_args()));
293
+ }
294
+
295
+ /**
296
+ * Determine if the collection is not empty.
297
+ *
298
+ * @return bool
299
+ */
300
+ public function isNotEmpty()
301
+ {
302
+ return ! $this->isEmpty();
303
+ }
304
+
305
+ /**
306
+ * Run a map over each nested chunk of items.
307
+ *
308
+ * @param callable $callback
309
+ * @return static
310
+ */
311
+ public function mapSpread(callable $callback)
312
+ {
313
+ return $this->map(function ($chunk, $key) use ($callback) {
314
+ $chunk[] = $key;
315
+
316
+ return $callback(...$chunk);
317
+ });
318
+ }
319
+
320
+ /**
321
+ * Run a grouping map over the items.
322
+ *
323
+ * The callback should return an associative array with a single key/value pair.
324
+ *
325
+ * @param callable $callback
326
+ * @return static
327
+ */
328
+ public function mapToGroups(callable $callback)
329
+ {
330
+ $groups = $this->mapToDictionary($callback);
331
+
332
+ return $groups->map([$this, 'make']);
333
+ }
334
+
335
+ /**
336
+ * Map a collection and flatten the result by a single level.
337
+ *
338
+ * @param callable $callback
339
+ * @return static
340
+ */
341
+ public function flatMap(callable $callback)
342
+ {
343
+ return $this->map($callback)->collapse();
344
+ }
345
+
346
+ /**
347
+ * Map the values into a new class.
348
+ *
349
+ * @param string $class
350
+ * @return static
351
+ */
352
+ public function mapInto($class)
353
+ {
354
+ return $this->map(function ($value, $key) use ($class) {
355
+ return new $class($value, $key);
356
+ });
357
+ }
358
+
359
+ /**
360
+ * Get the min value of a given key.
361
+ *
362
+ * @param callable|string|null $callback
363
+ * @return mixed
364
+ */
365
+ public function min($callback = null)
366
+ {
367
+ $callback = $this->valueRetriever($callback);
368
+
369
+ return $this->map(function ($value) use ($callback) {
370
+ return $callback($value);
371
+ })->filter(function ($value) {
372
+ return ! is_null($value);
373
+ })->reduce(function ($result, $value) {
374
+ return is_null($result) || $value < $result ? $value : $result;
375
+ });
376
+ }
377
+
378
+ /**
379
+ * Get the max value of a given key.
380
+ *
381
+ * @param callable|string|null $callback
382
+ * @return mixed
383
+ */
384
+ public function max($callback = null)
385
+ {
386
+ $callback = $this->valueRetriever($callback);
387
+
388
+ return $this->filter(function ($value) {
389
+ return ! is_null($value);
390
+ })->reduce(function ($result, $item) use ($callback) {
391
+ $value = $callback($item);
392
+
393
+ return is_null($result) || $value > $result ? $value : $result;
394
+ });
395
+ }
396
+
397
+ /**
398
+ * "Paginate" the collection by slicing it into a smaller collection.
399
+ *
400
+ * @param int $page
401
+ * @param int $perPage
402
+ * @return static
403
+ */
404
+ public function forPage($page, $perPage)
405
+ {
406
+ $offset = max(0, ($page - 1) * $perPage);
407
+
408
+ return $this->slice($offset, $perPage);
409
+ }
410
+
411
+ /**
412
+ * Partition the collection into two arrays using the given callback or key.
413
+ *
414
+ * @param callable|string $key
415
+ * @param mixed $operator
416
+ * @param mixed $value
417
+ * @return static
418
+ */
419
+ public function partition($key, $operator = null, $value = null)
420
+ {
421
+ $passed = [];
422
+ $failed = [];
423
+
424
+ $callback = func_num_args() === 1
425
+ ? $this->valueRetriever($key)
426
+ : $this->operatorForWhere(...func_get_args());
427
+
428
+ foreach ($this as $key => $item) {
429
+ if ($callback($item, $key)) {
430
+ $passed[$key] = $item;
431
+ } else {
432
+ $failed[$key] = $item;
433
+ }
434
+ }
435
+
436
+ return new static([new static($passed), new static($failed)]);
437
+ }
438
+
439
+ /**
440
+ * Get the sum of the given values.
441
+ *
442
+ * @param callable|string|null $callback
443
+ * @return mixed
444
+ */
445
+ public function sum($callback = null)
446
+ {
447
+ $callback = is_null($callback)
448
+ ? $this->identity()
449
+ : $this->valueRetriever($callback);
450
+
451
+ return $this->reduce(function ($result, $item) use ($callback) {
452
+ return $result + $callback($item);
453
+ }, 0);
454
+ }
455
+
456
+ /**
457
+ * Apply the callback if the value is truthy.
458
+ *
459
+ * @param bool|mixed $value
460
+ * @param callable|null $callback
461
+ * @param callable|null $default
462
+ * @return static|mixed
463
+ */
464
+ public function when($value, callable $callback = null, callable $default = null)
465
+ {
466
+ if (! $callback) {
467
+ return new HigherOrderWhenProxy($this, $value);
468
+ }
469
+
470
+ if ($value) {
471
+ return $callback($this, $value);
472
+ } elseif ($default) {
473
+ return $default($this, $value);
474
+ }
475
+
476
+ return $this;
477
+ }
478
+
479
+ /**
480
+ * Apply the callback if the collection is empty.
481
+ *
482
+ * @param callable $callback
483
+ * @param callable|null $default
484
+ * @return static|mixed
485
+ */
486
+ public function whenEmpty(callable $callback, callable $default = null)
487
+ {
488
+ return $this->when($this->isEmpty(), $callback, $default);
489
+ }
490
+
491
+ /**
492
+ * Apply the callback if the collection is not empty.
493
+ *
494
+ * @param callable $callback
495
+ * @param callable|null $default
496
+ * @return static|mixed
497
+ */
498
+ public function whenNotEmpty(callable $callback, callable $default = null)
499
+ {
500
+ return $this->when($this->isNotEmpty(), $callback, $default);
501
+ }
502
+
503
+ /**
504
+ * Apply the callback if the value is falsy.
505
+ *
506
+ * @param bool $value
507
+ * @param callable $callback
508
+ * @param callable|null $default
509
+ * @return static|mixed
510
+ */
511
+ public function unless($value, callable $callback, callable $default = null)
512
+ {
513
+ return $this->when(! $value, $callback, $default);
514
+ }
515
+
516
+ /**
517
+ * Apply the callback unless the collection is empty.
518
+ *
519
+ * @param callable $callback
520
+ * @param callable|null $default
521
+ * @return static|mixed
522
+ */
523
+ public function unlessEmpty(callable $callback, callable $default = null)
524
+ {
525
+ return $this->whenNotEmpty($callback, $default);
526
+ }
527
+
528
+ /**
529
+ * Apply the callback unless the collection is not empty.
530
+ *
531
+ * @param callable $callback
532
+ * @param callable|null $default
533
+ * @return static|mixed
534
+ */
535
+ public function unlessNotEmpty(callable $callback, callable $default = null)
536
+ {
537
+ return $this->whenEmpty($callback, $default);
538
+ }
539
+
540
+ /**
541
+ * Filter items by the given key value pair.
542
+ *
543
+ * @param string $key
544
+ * @param mixed $operator
545
+ * @param mixed $value
546
+ * @return static
547
+ */
548
+ public function where($key, $operator = null, $value = null)
549
+ {
550
+ return $this->filter($this->operatorForWhere(...func_get_args()));
551
+ }
552
+
553
+ /**
554
+ * Filter items where the value for the given key is null.
555
+ *
556
+ * @param string|null $key
557
+ * @return static
558
+ */
559
+ public function whereNull($key = null)
560
+ {
561
+ return $this->whereStrict($key, null);
562
+ }
563
+
564
+ /**
565
+ * Filter items where the value for the given key is not null.
566
+ *
567
+ * @param string|null $key
568
+ * @return static
569
+ */
570
+ public function whereNotNull($key = null)
571
+ {
572
+ return $this->where($key, '!==', null);
573
+ }
574
+
575
+ /**
576
+ * Filter items by the given key value pair using strict comparison.
577
+ *
578
+ * @param string $key
579
+ * @param mixed $value
580
+ * @return static
581
+ */
582
+ public function whereStrict($key, $value)
583
+ {
584
+ return $this->where($key, '===', $value);
585
+ }
586
+
587
+ /**
588
+ * Filter items by the given key value pair.
589
+ *
590
+ * @param string $key
591
+ * @param mixed $values
592
+ * @param bool $strict
593
+ * @return static
594
+ */
595
+ public function whereIn($key, $values, $strict = false)
596
+ {
597
+ $values = $this->getArrayableItems($values);
598
+
599
+ return $this->filter(function ($item) use ($key, $values, $strict) {
600
+ return in_array(data_get($item, $key), $values, $strict);
601
+ });
602
+ }
603
+
604
+ /**
605
+ * Filter items by the given key value pair using strict comparison.
606
+ *
607
+ * @param string $key
608
+ * @param mixed $values
609
+ * @return static
610
+ */
611
+ public function whereInStrict($key, $values)
612
+ {
613
+ return $this->whereIn($key, $values, true);
614
+ }
615
+
616
+ /**
617
+ * Filter items such that the value of the given key is between the given values.
618
+ *
619
+ * @param string $key
620
+ * @param array $values
621
+ * @return static
622
+ */
623
+ public function whereBetween($key, $values)
624
+ {
625
+ return $this->where($key, '>=', reset($values))->where($key, '<=', end($values));
626
+ }
627
+
628
+ /**
629
+ * Filter items such that the value of the given key is not between the given values.
630
+ *
631
+ * @param string $key
632
+ * @param array $values
633
+ * @return static
634
+ */
635
+ public function whereNotBetween($key, $values)
636
+ {
637
+ return $this->filter(function ($item) use ($key, $values) {
638
+ return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
639
+ });
640
+ }
641
+
642
+ /**
643
+ * Filter items by the given key value pair.
644
+ *
645
+ * @param string $key
646
+ * @param mixed $values
647
+ * @param bool $strict
648
+ * @return static
649
+ */
650
+ public function whereNotIn($key, $values, $strict = false)
651
+ {
652
+ $values = $this->getArrayableItems($values);
653
+
654
+ return $this->reject(function ($item) use ($key, $values, $strict) {
655
+ return in_array(data_get($item, $key), $values, $strict);
656
+ });
657
+ }
658
+
659
+ /**
660
+ * Filter items by the given key value pair using strict comparison.
661
+ *
662
+ * @param string $key
663
+ * @param mixed $values
664
+ * @return static
665
+ */
666
+ public function whereNotInStrict($key, $values)
667
+ {
668
+ return $this->whereNotIn($key, $values, true);
669
+ }
670
+
671
+ /**
672
+ * Filter the items, removing any items that don't match the given type(s).
673
+ *
674
+ * @param string|string[] $type
675
+ * @return static
676
+ */
677
+ public function whereInstanceOf($type)
678
+ {
679
+ return $this->filter(function ($value) use ($type) {
680
+ if (is_array($type)) {
681
+ foreach ($type as $classType) {
682
+ if ($value instanceof $classType) {
683
+ return true;
684
+ }
685
+ }
686
+
687
+ return false;
688
+ }
689
+
690
+ return $value instanceof $type;
691
+ });
692
+ }
693
+
694
+ /**
695
+ * Pass the collection to the given callback and return the result.
696
+ *
697
+ * @param callable $callback
698
+ * @return mixed
699
+ */
700
+ public function pipe(callable $callback)
701
+ {
702
+ return $callback($this);
703
+ }
704
+
705
+ /**
706
+ * Pass the collection into a new class.
707
+ *
708
+ * @param string $class
709
+ * @return mixed
710
+ */
711
+ public function pipeInto($class)
712
+ {
713
+ return new $class($this);
714
+ }
715
+
716
+ /**
717
+ * Pass the collection to the given callback and then return it.
718
+ *
719
+ * @param callable $callback
720
+ * @return $this
721
+ */
722
+ public function tap(callable $callback)
723
+ {
724
+ $callback(clone $this);
725
+
726
+ return $this;
727
+ }
728
+
729
+ /**
730
+ * Reduce the collection to a single value.
731
+ *
732
+ * @param callable $callback
733
+ * @param mixed $initial
734
+ * @return mixed
735
+ */
736
+ public function reduce(callable $callback, $initial = null)
737
+ {
738
+ $result = $initial;
739
+
740
+ foreach ($this as $key => $value) {
741
+ $result = $callback($result, $value, $key);
742
+ }
743
+
744
+ return $result;
745
+ }
746
+
747
+ /**
748
+ * Reduce an associative collection to a single value.
749
+ *
750
+ * @param callable $callback
751
+ * @param mixed $initial
752
+ * @return mixed
753
+ */
754
+ public function reduceWithKeys(callable $callback, $initial = null)
755
+ {
756
+ $result = $initial;
757
+
758
+ foreach ($this as $key => $value) {
759
+ $result = $callback($result, $value, $key);
760
+ }
761
+
762
+ return $result;
763
+ }
764
+
765
+ /**
766
+ * Create a collection of all elements that do not pass a given truth test.
767
+ *
768
+ * @param callable|mixed $callback
769
+ * @return static
770
+ */
771
+ public function reject($callback = true)
772
+ {
773
+ $useAsCallable = $this->useAsCallable($callback);
774
+
775
+ return $this->filter(function ($value, $key) use ($callback, $useAsCallable) {
776
+ return $useAsCallable
777
+ ? ! $callback($value, $key)
778
+ : $value != $callback;
779
+ });
780
+ }
781
+
782
+ /**
783
+ * Return only unique items from the collection array.
784
+ *
785
+ * @param string|callable|null $key
786
+ * @param bool $strict
787
+ * @return static
788
+ */
789
+ public function unique($key = null, $strict = false)
790
+ {
791
+ $callback = $this->valueRetriever($key);
792
+
793
+ $exists = [];
794
+
795
+ return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) {
796
+ if (in_array($id = $callback($item, $key), $exists, $strict)) {
797
+ return true;
798
+ }
799
+
800
+ $exists[] = $id;
801
+ });
802
+ }
803
+
804
+ /**
805
+ * Return only unique items from the collection array using strict comparison.
806
+ *
807
+ * @param string|callable|null $key
808
+ * @return static
809
+ */
810
+ public function uniqueStrict($key = null)
811
+ {
812
+ return $this->unique($key, true);
813
+ }
814
+
815
+ /**
816
+ * Collect the values into a collection.
817
+ *
818
+ * @return \Illuminate\Support\Collection
819
+ */
820
+ public function collect()
821
+ {
822
+ return new Collection($this->all());
823
+ }
824
+
825
+ /**
826
+ * Get the collection of items as a plain array.
827
+ *
828
+ * @return array
829
+ */
830
+ public function toArray()
831
+ {
832
+ return $this->map(function ($value) {
833
+ return $value instanceof Arrayable ? $value->toArray() : $value;
834
+ })->all();
835
+ }
836
+
837
+ /**
838
+ * Convert the object into something JSON serializable.
839
+ *
840
+ * @return array
841
+ */
842
+ public function jsonSerialize()
843
+ {
844
+ return array_map(function ($value) {
845
+ if ($value instanceof JsonSerializable) {
846
+ return $value->jsonSerialize();
847
+ } elseif ($value instanceof Jsonable) {
848
+ return json_decode($value->toJson(), true);
849
+ } elseif ($value instanceof Arrayable) {
850
+ return $value->toArray();
851
+ }
852
+
853
+ return $value;
854
+ }, $this->all());
855
+ }
856
+
857
+ /**
858
+ * Get the collection of items as JSON.
859
+ *
860
+ * @param int $options
861
+ * @return string
862
+ */
863
+ public function toJson($options = 0)
864
+ {
865
+ return json_encode($this->jsonSerialize(), $options);
866
+ }
867
+
868
+ /**
869
+ * Get a CachingIterator instance.
870
+ *
871
+ * @param int $flags
872
+ * @return \CachingIterator
873
+ */
874
+ public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING)
875
+ {
876
+ return new CachingIterator($this->getIterator(), $flags);
877
+ }
878
+
879
+ /**
880
+ * Convert the collection to its string representation.
881
+ *
882
+ * @return string
883
+ */
884
+ public function __toString()
885
+ {
886
+ return $this->toJson();
887
+ }
888
+
889
+ /**
890
+ * Add a method to the list of proxied methods.
891
+ *
892
+ * @param string $method
893
+ * @return void
894
+ */
895
+ public static function proxy($method)
896
+ {
897
+ static::$proxies[] = $method;
898
+ }
899
+
900
+ /**
901
+ * Dynamically access collection proxies.
902
+ *
903
+ * @param string $key
904
+ * @return mixed
905
+ *
906
+ * @throws \Exception
907
+ */
908
+ public function __get($key)
909
+ {
910
+ if (! in_array($key, static::$proxies)) {
911
+ throw new Exception("Property [{$key}] does not exist on this collection instance.");
912
+ }
913
+
914
+ return new HigherOrderCollectionProxy($this, $key);
915
+ }
916
+
917
+ /**
918
+ * Results array of items from Collection or Arrayable.
919
+ *
920
+ * @param mixed $items
921
+ * @return array
922
+ */
923
+ protected function getArrayableItems($items)
924
+ {
925
+ if (is_array($items)) {
926
+ return $items;
927
+ } elseif ($items instanceof Enumerable) {
928
+ return $items->all();
929
+ } elseif ($items instanceof Arrayable) {
930
+ return $items->toArray();
931
+ } elseif ($items instanceof Jsonable) {
932
+ return json_decode($items->toJson(), true);
933
+ } elseif ($items instanceof JsonSerializable) {
934
+ return (array) $items->jsonSerialize();
935
+ } elseif ($items instanceof Traversable) {
936
+ return iterator_to_array($items);
937
+ }
938
+
939
+ return (array) $items;
940
+ }
941
+
942
+ /**
943
+ * Get an operator checker callback.
944
+ *
945
+ * @param string $key
946
+ * @param string|null $operator
947
+ * @param mixed $value
948
+ * @return \Closure
949
+ */
950
+ protected function operatorForWhere($key, $operator = null, $value = null)
951
+ {
952
+ if (func_num_args() === 1) {
953
+ $value = true;
954
+
955
+ $operator = '=';
956
+ }
957
+
958
+ if (func_num_args() === 2) {
959
+ $value = $operator;
960
+
961
+ $operator = '=';
962
+ }
963
+
964
+ return function ($item) use ($key, $operator, $value) {
965
+ $retrieved = data_get($item, $key);
966
+
967
+ $strings = array_filter([$retrieved, $value], function ($value) {
968
+ return is_string($value) || (is_object($value) && method_exists($value, '__toString'));
969
+ });
970
+
971
+ if (count($strings) < 2 && count(array_filter([$retrieved, $value], 'is_object')) == 1) {
972
+ return in_array($operator, ['!=', '<>', '!==']);
973
+ }
974
+
975
+ switch ($operator) {
976
+ default:
977
+ case '=':
978
+ case '==': return $retrieved == $value;
979
+ case '!=':
980
+ case '<>': return $retrieved != $value;
981
+ case '<': return $retrieved < $value;
982
+ case '>': return $retrieved > $value;
983
+ case '<=': return $retrieved <= $value;
984
+ case '>=': return $retrieved >= $value;
985
+ case '===': return $retrieved === $value;
986
+ case '!==': return $retrieved !== $value;
987
+ }
988
+ };
989
+ }
990
+
991
+ /**
992
+ * Determine if the given value is callable, but not a string.
993
+ *
994
+ * @param mixed $value
995
+ * @return bool
996
+ */
997
+ protected function useAsCallable($value)
998
+ {
999
+ return ! is_string($value) && is_callable($value);
1000
+ }
1001
+
1002
+ /**
1003
+ * Get a value retrieving callback.
1004
+ *
1005
+ * @param callable|string|null $value
1006
+ * @return callable
1007
+ */
1008
+ protected function valueRetriever($value)
1009
+ {
1010
+ if ($this->useAsCallable($value)) {
1011
+ return $value;
1012
+ }
1013
+
1014
+ return function ($item) use ($value) {
1015
+ return data_get($item, $value);
1016
+ };
1017
+ }
1018
+
1019
+ /**
1020
+ * Make a function to check an item's equality.
1021
+ *
1022
+ * @param mixed $value
1023
+ * @return \Closure
1024
+ */
1025
+ protected function equality($value)
1026
+ {
1027
+ return function ($item) use ($value) {
1028
+ return $item === $value;
1029
+ };
1030
+ }
1031
+
1032
+ /**
1033
+ * Make a function using another function, by negating its result.
1034
+ *
1035
+ * @param \Closure $callback
1036
+ * @return \Closure
1037
+ */
1038
+ protected function negate(Closure $callback)
1039
+ {
1040
+ return function (...$params) use ($callback) {
1041
+ return ! $callback(...$params);
1042
+ };
1043
+ }
1044
+
1045
+ /**
1046
+ * Make a function that returns what's passed to it.
1047
+ *
1048
+ * @return \Closure
1049
+ */
1050
+ protected function identity()
1051
+ {
1052
+ return function ($value) {
1053
+ return $value;
1054
+ };
1055
+ }
1056
+ }
vendor/illuminate/collections/composer.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "illuminate/collections",
3
+ "description": "The Illuminate Collections package.",
4
+ "license": "MIT",
5
+ "homepage": "https://laravel.com",
6
+ "support": {
7
+ "issues": "https://github.com/laravel/framework/issues",
8
+ "source": "https://github.com/laravel/framework"
9
+ },
10
+ "authors": [
11
+ {
12
+ "name": "Taylor Otwell",
13
+ "email": "taylor@laravel.com"
14
+ }
15
+ ],
16
+ "require": {
17
+ "php": "^7.3|^8.0",
18
+ "illuminate/contracts": "^8.0",
19
+ "illuminate/macroable": "^8.0"
20
+ },
21
+ "autoload": {
22
+ "psr-4": {
23
+ "Illuminate\\Support\\": ""
24
+ },
25
+ "files": [
26
+ "helpers.php"
27
+ ]
28
+ },
29
+ "extra": {
30
+ "branch-alias": {
31
+ "dev-master": "8.x-dev"
32
+ }
33
+ },
34
+ "suggest": {
35
+ "symfony/var-dumper": "Required to use the dump method (^5.1.4)."
36
+ },
37
+ "config": {
38
+ "sort-packages": true
39
+ },
40
+ "minimum-stability": "dev"
41
+ }
vendor/illuminate/collections/helpers.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use Illuminate\Support\Arr;
4
+ use Illuminate\Support\Collection;
5
+
6
+ if (! function_exists('collect')) {
7
+ /**
8
+ * Create a collection from the given value.
9
+ *
10
+ * @param mixed $value
11
+ * @return \Illuminate\Support\Collection
12
+ */
13
+ function collect($value = null)
14
+ {
15
+ return new Collection($value);
16
+ }
17
+ }
18
+
19
+ if (! function_exists('data_fill')) {
20
+ /**
21
+ * Fill in data where it's missing.
22
+ *
23
+ * @param mixed $target
24
+ * @param string|array $key
25
+ * @param mixed $value
26
+ * @return mixed
27
+ */
28
+ function data_fill(&$target, $key, $value)
29
+ {
30
+ return data_set($target, $key, $value, false);
31
+ }
32
+ }
33
+
34
+ if (! function_exists('data_get')) {
35
+ /**
36
+ * Get an item from an array or object using "dot" notation.
37
+ *
38
+ * @param mixed $target
39
+ * @param string|array|int|null $key
40
+ * @param mixed $default
41
+ * @return mixed
42
+ */
43
+ function data_get($target, $key, $default = null)
44
+ {
45
+ if (is_null($key)) {
46
+ return $target;
47
+ }
48
+
49
+ $key = is_array($key) ? $key : explode('.', $key);
50
+
51
+ foreach ($key as $i => $segment) {
52
+ unset($key[$i]);
53
+
54
+ if (is_null($segment)) {
55
+ return $target;
56
+ }
57
+
58
+ if ($segment === '*') {
59
+ if ($target instanceof Collection) {
60
+ $target = $target->all();
61
+ } elseif (! is_array($target)) {
62
+ return value($default);
63
+ }
64
+
65
+ $result = [];
66
+
67
+ foreach ($target as $item) {
68
+ $result[] = data_get($item, $key);
69
+ }
70
+
71
+ return in_array('*', $key) ? Arr::collapse($result) : $result;
72
+ }
73
+
74
+ if (Arr::accessible($target) && Arr::exists($target, $segment)) {
75
+ $target = $target[$segment];
76
+ } elseif (is_object($target) && isset($target->{$segment})) {
77
+ $target = $target->{$segment};
78
+ } else {
79
+ return value($default);
80
+ }
81
+ }
82
+
83
+ return $target;
84
+ }
85
+ }
86
+
87
+ if (! function_exists('data_set')) {
88
+ /**
89
+ * Set an item on an array or object using dot notation.
90
+ *
91
+ * @param mixed $target
92
+ * @param string|array $key
93
+ * @param mixed $value
94
+ * @param bool $overwrite
95
+ * @return mixed
96
+ */
97
+ function data_set(&$target, $key, $value, $overwrite = true)
98
+ {
99
+ $segments = is_array($key) ? $key : explode('.', $key);
100
+
101
+ if (($segment = array_shift($segments)) === '*') {
102
+ if (! Arr::accessible($target)) {
103
+ $target = [];
104
+ }
105
+
106
+ if ($segments) {
107
+ foreach ($target as &$inner) {
108
+ data_set($inner, $segments, $value, $overwrite);
109
+ }
110
+ } elseif ($overwrite) {
111
+ foreach ($target as &$inner) {
112
+ $inner = $value;
113
+ }
114
+ }
115
+ } elseif (Arr::accessible($target)) {
116
+ if ($segments) {
117
+ if (! Arr::exists($target, $segment)) {
118
+ $target[$segment] = [];
119
+ }
120
+
121
+ data_set($target[$segment], $segments, $value, $overwrite);
122
+ } elseif ($overwrite || ! Arr::exists($target, $segment)) {
123
+ $target[$segment] = $value;
124
+ }
125
+ } elseif (is_object($target)) {
126
+ if ($segments) {
127
+ if (! isset($target->{$segment})) {
128
+ $target->{$segment} = [];
129
+ }
130
+
131
+ data_set($target->{$segment}, $segments, $value, $overwrite);
132
+ } elseif ($overwrite || ! isset($target->{$segment})) {
133
+ $target->{$segment} = $value;
134
+ }
135
+ } else {
136
+ $target = [];
137
+
138
+ if ($segments) {
139
+ data_set($target[$segment], $segments, $value, $overwrite);
140
+ } elseif ($overwrite) {
141
+ $target[$segment] = $value;
142
+ }
143
+ }
144
+
145
+ return $target;
146
+ }
147
+ }
148
+
149
+ if (! function_exists('head')) {
150
+ /**
151
+ * Get the first element of an array. Useful for method chaining.
152
+ *
153
+ * @param array $array
154
+ * @return mixed
155
+ */
156
+ function head($array)
157
+ {
158
+ return reset($array);
159
+ }
160
+ }
161
+
162
+ if (! function_exists('last')) {
163
+ /**
164
+ * Get the last element from an array.
165
+ *
166
+ * @param array $array
167
+ * @return mixed
168
+ */
169
+ function last($array)
170
+ {
171
+ return end($array);
172
+ }
173
+ }
174
+
175
+ if (! function_exists('value')) {
176
+ /**
177
+ * Return the default value of the given value.
178
+ *
179
+ * @param mixed $value
180
+ * @return mixed
181
+ */
182
+ function value($value, ...$args)
183
+ {
184
+ return $value instanceof Closure ? $value(...$args) : $value;
185
+ }
186
+ }
vendor/illuminate/config/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Taylor Otwell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
vendor/illuminate/config/Repository.php CHANGED
@@ -3,8 +3,8 @@
3
  namespace Illuminate\Config;
4
 
5
  use ArrayAccess;
6
- use Illuminate\Support\Arr;
7
  use Illuminate\Contracts\Config\Repository as ConfigContract;
 
8
 
9
  class Repository implements ArrayAccess, ConfigContract
10
  {
@@ -40,20 +40,45 @@ class Repository implements ArrayAccess, ConfigContract
40
  /**
41
  * Get the specified configuration value.
42
  *
43
- * @param string $key
44
- * @param mixed $default
45
  * @return mixed
46
  */
47
  public function get($key, $default = null)
48
  {
 
 
 
 
49
  return Arr::get($this->items, $key, $default);
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
  * Set a given configuration value.
54
  *
55
  * @param array|string $key
56
- * @param mixed $value
57
  * @return void
58
  */
59
  public function set($key, $value = null)
3
  namespace Illuminate\Config;
4
 
5
  use ArrayAccess;
 
6
  use Illuminate\Contracts\Config\Repository as ConfigContract;
7
+ use Illuminate\Support\Arr;
8
 
9
  class Repository implements ArrayAccess, ConfigContract
10
  {
40
  /**
41
  * Get the specified configuration value.
42
  *
43
+ * @param array|string $key
44
+ * @param mixed $default
45
  * @return mixed
46
  */
47
  public function get($key, $default = null)
48
  {
49
+ if (is_array($key)) {
50
+ return $this->getMany($key);
51
+ }
52
+
53
  return Arr::get($this->items, $key, $default);
54
  }
55
 
56
+ /**
57
+ * Get many configuration values.
58
+ *
59
+ * @param array $keys
60
+ * @return array
61
+ */
62
+ public function getMany($keys)
63
+ {
64
+ $config = [];
65
+
66
+ foreach ($keys as $key => $default) {
67
+ if (is_numeric($key)) {
68
+ [$key, $default] = [$default, null];
69
+ }
70
+
71
+ $config[$key] = Arr::get($this->items, $key, $default);
72
+ }
73
+
74
+ return $config;
75
+ }
76
+
77
  /**
78
  * Set a given configuration value.
79
  *
80
  * @param array|string $key
81
+ * @param mixed $value
82
  * @return void
83
  */
84
  public function set($key, $value = null)
vendor/illuminate/config/composer.json CHANGED
@@ -14,9 +14,9 @@
14
  }
15
  ],
16
  "require": {
17
- "php": ">=5.6.4",
18
- "illuminate/contracts": "5.4.*",
19
- "illuminate/support": "5.4.*"
20
  },
21
  "autoload": {
22
  "psr-4": {
@@ -25,7 +25,7 @@
25
  },
26
  "extra": {
27
  "branch-alias": {
28
- "dev-master": "5.4-dev"
29
  }
30
  },
31
  "config": {
14
  }
15
  ],
16
  "require": {
17
+ "php": "^7.3|^8.0",
18
+ "illuminate/collections": "^8.0",
19
+ "illuminate/contracts": "^8.0"
20
  },
21
  "autoload": {
22
  "psr-4": {
25
  },
26
  "extra": {
27
  "branch-alias": {
28
+ "dev-master": "8.x-dev"
29
  }
30
  },
31
  "config": {
vendor/illuminate/container/BoundMethod.php CHANGED
@@ -3,9 +3,10 @@
3
  namespace Illuminate\Container;
4
 
5
  use Closure;
6
- use ReflectionMethod;
7
- use ReflectionFunction;
8
  use InvalidArgumentException;
 
 
9
 
10
  class BoundMethod
11
  {
@@ -17,17 +18,22 @@ class BoundMethod
17
  * @param array $parameters
18
  * @param string|null $defaultMethod
19
  * @return mixed
 
 
 
20
  */
21
  public static function call($container, $callback, array $parameters = [], $defaultMethod = null)
22
  {
 
 
 
 
23
  if (static::isCallableWithAtSign($callback) || $defaultMethod) {
24
  return static::callClass($container, $callback, $parameters, $defaultMethod);
25
  }
26
 
27
  return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
28
- return call_user_func_array(
29
- $callback, static::getMethodDependencies($container, $callback, $parameters)
30
- );
31
  });
32
  }
33
 
@@ -49,7 +55,7 @@ class BoundMethod
49
  // We will assume an @ sign is used to delimit the class name from the method
50
  // name. We will split on this @ sign and then build a callable array that
51
  // we can pass right back into the "call" method for dependency binding.
52
- $method = count($segments) == 2
53
  ? $segments[1] : $defaultMethod;
54
 
55
  if (is_null($method)) {
@@ -72,7 +78,7 @@ class BoundMethod
72
  protected static function callBoundMethod($container, $callback, $default)
73
  {
74
  if (! is_array($callback)) {
75
- return $default instanceof Closure ? $default() : $default;
76
  }
77
 
78
  // Here we need to turn the array callable into a Class@method string we can use to
@@ -84,7 +90,7 @@ class BoundMethod
84
  return $container->callMethodBinding($method, $callback[0]);
85
  }
86
 
87
- return $default instanceof Closure ? $default() : $default;
88
  }
89
 
90
  /**
@@ -103,10 +109,12 @@ class BoundMethod
103
  /**
104
  * Get all dependencies for a given method.
105
  *
106
- * @param \Illuminate\Container\Container
107
  * @param callable|string $callback
108
  * @param array $parameters
109
  * @return array
 
 
110
  */
111
  protected static function getMethodDependencies($container, $callback, array $parameters = [])
112
  {
@@ -116,7 +124,7 @@ class BoundMethod
116
  static::addDependencyForCallParameter($container, $parameter, $parameters, $dependencies);
117
  }
118
 
119
- return array_merge($dependencies, $parameters);
120
  }
121
 
122
  /**
@@ -124,11 +132,15 @@ class BoundMethod
124
  *
125
  * @param callable|string $callback
126
  * @return \ReflectionFunctionAbstract
 
 
127
  */
128
  protected static function getCallReflector($callback)
129
  {
130
  if (is_string($callback) && strpos($callback, '::') !== false) {
131
  $callback = explode('::', $callback);
 
 
132
  }
133
 
134
  return is_array($callback)
@@ -143,19 +155,29 @@ class BoundMethod
143
  * @param \ReflectionParameter $parameter
144
  * @param array $parameters
145
  * @param array $dependencies
146
- * @return mixed
147
  */
148
  protected static function addDependencyForCallParameter($container, $parameter,
149
  array &$parameters, &$dependencies)
150
  {
151
- if (array_key_exists($parameter->name, $parameters)) {
152
- $dependencies[] = $parameters[$parameter->name];
153
-
154
- unset($parameters[$parameter->name]);
155
- } elseif ($parameter->getClass()) {
156
- $dependencies[] = $container->make($parameter->getClass()->name);
 
 
 
 
 
 
157
  } elseif ($parameter->isDefaultValueAvailable()) {
158
  $dependencies[] = $parameter->getDefaultValue();
 
 
 
 
159
  }
160
  }
161
 
3
  namespace Illuminate\Container;
4
 
5
  use Closure;
6
+ use Illuminate\Contracts\Container\BindingResolutionException;
 
7
  use InvalidArgumentException;
8
+ use ReflectionFunction;
9
+ use ReflectionMethod;
10
 
11
  class BoundMethod
12
  {
18
  * @param array $parameters
19
  * @param string|null $defaultMethod
20
  * @return mixed
21
+ *
22
+ * @throws \ReflectionException
23
+ * @throws \InvalidArgumentException
24
  */
25
  public static function call($container, $callback, array $parameters = [], $defaultMethod = null)
26
  {
27
+ if (is_string($callback) && ! $defaultMethod && method_exists($callback, '__invoke')) {
28
+ $defaultMethod = '__invoke';
29
+ }
30
+
31
  if (static::isCallableWithAtSign($callback) || $defaultMethod) {
32
  return static::callClass($container, $callback, $parameters, $defaultMethod);
33
  }
34
 
35
  return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
36
+ return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
 
 
37
  });
38
  }
39
 
55
  // We will assume an @ sign is used to delimit the class name from the method
56
  // name. We will split on this @ sign and then build a callable array that
57
  // we can pass right back into the "call" method for dependency binding.
58
+ $method = count($segments) === 2
59
  ? $segments[1] : $defaultMethod;
60
 
61
  if (is_null($method)) {
78
  protected static function callBoundMethod($container, $callback, $default)
79
  {
80
  if (! is_array($callback)) {
81
+ return Util::unwrapIfClosure($default);
82
  }
83
 
84
  // Here we need to turn the array callable into a Class@method string we can use to
90
  return $container->callMethodBinding($method, $callback[0]);
91
  }
92
 
93
+ return Util::unwrapIfClosure($default);
94
  }
95
 
96
  /**
109
  /**
110
  * Get all dependencies for a given method.
111
  *
112
+ * @param \Illuminate\Container\Container $container
113
  * @param callable|string $callback
114
  * @param array $parameters
115
  * @return array
116
+ *
117
+ * @throws \ReflectionException
118
  */
119
  protected static function getMethodDependencies($container, $callback, array $parameters = [])
120
  {
124
  static::addDependencyForCallParameter($container, $parameter, $parameters, $dependencies);
125
  }
126
 
127
+ return array_merge($dependencies, array_values($parameters));
128
  }
129
 
130
  /**
132
  *
133
  * @param callable|string $callback
134
  * @return \ReflectionFunctionAbstract
135
+ *
136
+ * @throws \ReflectionException
137
  */
138
  protected static function getCallReflector($callback)
139
  {
140
  if (is_string($callback) && strpos($callback, '::') !== false) {
141
  $callback = explode('::', $callback);
142
+ } elseif (is_object($callback) && ! $callback instanceof Closure) {
143
+ $callback = [$callback, '__invoke'];
144
  }
145
 
146
  return is_array($callback)
155
  * @param \ReflectionParameter $parameter
156
  * @param array $parameters
157
  * @param array $dependencies
158
+ * @return void
159
  */
160
  protected static function addDependencyForCallParameter($container, $parameter,
161
  array &$parameters, &$dependencies)
162
  {
163
+ if (array_key_exists($paramName = $parameter->getName(), $parameters)) {
164
+ $dependencies[] = $parameters[$paramName];
165
+
166
+ unset($parameters[$paramName]);
167
+ } elseif (! is_null($className = Util::getParameterClassName($parameter))) {
168
+ if (array_key_exists($className, $parameters)) {
169
+ $dependencies[] = $parameters[$className];
170
+
171
+ unset($parameters[$className]);
172
+ } else {
173
+ $dependencies[] = $container->make($className);
174
+ }
175
  } elseif ($parameter->isDefaultValueAvailable()) {
176
  $dependencies[] = $parameter->getDefaultValue();
177
+ } elseif (! $parameter->isOptional() && ! array_key_exists($paramName, $parameters)) {
178
+ $message = "Unable to resolve dependency [{$parameter}] in class {$parameter->getDeclaringClass()->getName()}";
179
+
180
+ throw new BindingResolutionException($message);
181
  }
182
  }
183
 
vendor/illuminate/container/Container.php CHANGED
@@ -2,13 +2,16 @@
2
 
3
  namespace Illuminate\Container;
4
 
5
- use Closure;
6
  use ArrayAccess;
 
 
 
 
 
7
  use LogicException;
8
  use ReflectionClass;
 
9
  use ReflectionParameter;
10
- use Illuminate\Contracts\Container\BindingResolutionException;
11
- use Illuminate\Contracts\Container\Container as ContainerContract;
12
 
13
  class Container implements ArrayAccess, ContainerContract
14
  {
@@ -22,124 +25,144 @@ class Container implements ArrayAccess, ContainerContract
22
  /**
23
  * An array of the types that have been resolved.
24
  *
25
- * @var array
26
  */
27
  protected $resolved = [];
28
 
29
  /**
30
  * The container's bindings.
31
  *
32
- * @var array
33
  */
34
  protected $bindings = [];
35
 
36
  /**
37
  * The container's method bindings.
38
  *
39
- * @var array
40
  */
41
  protected $methodBindings = [];
42
 
43
  /**
44
  * The container's shared instances.
45
  *
46
- * @var array
47
  */
48
  protected $instances = [];
49
 
50
  /**
51
  * The registered type aliases.
52
  *
53
- * @var array
54
  */
55
  protected $aliases = [];
56
 
57
  /**
58
  * The registered aliases keyed by the abstract name.
59
  *
60
- * @var array
61
  */
62
  protected $abstractAliases = [];
63
 
64
  /**
65
  * The extension closures for services.
66
  *
67
- * @var array
68
  */
69
  protected $extenders = [];
70
 
71
  /**
72
  * All of the registered tags.
73
  *
74
- * @var array
75
  */
76
  protected $tags = [];
77
 
78
  /**
79
  * The stack of concretions currently being built.
80
  *
81
- * @var array
82
  */
83
  protected $buildStack = [];
84
 
85
  /**
86
  * The parameter override stack.
87
  *
88
- * @var array
89
  */
90
  protected $with = [];
91
 
92
  /**
93
  * The contextual binding map.
94
  *
95
- * @var array
96
  */
97
  public $contextual = [];
98
 
99
  /**
100
  * All of the registered rebound callbacks.
101
  *
102
- * @var array
103
  */
104
  protected $reboundCallbacks = [];
105
 
 
 
 
 
 
 
 
106
  /**
107
  * All of the global resolving callbacks.
108
  *
109
- * @var array
110
  */
111
  protected $globalResolvingCallbacks = [];
112
 
113
  /**
114
  * All of the global after resolving callbacks.
115
  *
116
- * @var array
117
  */
118
  protected $globalAfterResolvingCallbacks = [];
119
 
 
 
 
 
 
 
 
120
  /**
121
  * All of the resolving callbacks by class type.
122
  *
123
- * @var array
124
  */
125
  protected $resolvingCallbacks = [];
126
 
127
  /**
128
  * All of the after resolving callbacks by class type.
129
  *
130
- * @var array
131
  */
132
  protected $afterResolvingCallbacks = [];
133
 
134
  /**
135
  * Define a contextual binding.
136
  *
137
- * @param string $concrete
138
  * @return \Illuminate\Contracts\Container\ContextualBindingBuilder
139
  */
140
  public function when($concrete)
141
  {
142
- return new ContextualBindingBuilder($this, $this->getAlias($concrete));
 
 
 
 
 
 
143
  }
144
 
145
  /**
@@ -155,6 +178,14 @@ class Container implements ArrayAccess, ContainerContract
155
  $this->isAlias($abstract);
156
  }
157
 
 
 
 
 
 
 
 
 
158
  /**
159
  * Determine if the given abstract type has been resolved.
160
  *
@@ -180,7 +211,7 @@ class Container implements ArrayAccess, ContainerContract
180
  public function isShared($abstract)
181
  {
182
  return isset($this->instances[$abstract]) ||
183
- (isset($this->bindings[$abstract]['shared']) &&
184
  $this->bindings[$abstract]['shared'] === true);
185
  }
186
 
@@ -198,18 +229,18 @@ class Container implements ArrayAccess, ContainerContract
198
  /**
199
  * Register a binding with the container.
200
  *
201
- * @param string|array $abstract
202
  * @param \Closure|string|null $concrete
203
  * @param bool $shared
204
  * @return void
205
  */
206
  public function bind($abstract, $concrete = null, $shared = false)
207
  {
 
 
208
  // If no concrete type was given, we will simply set the concrete type to the
209
  // abstract type. After that, the concrete type to be registered as shared
210
  // without being forced to state their classes in both of the parameters.
211
- $this->dropStaleInstances($abstract);
212
-
213
  if (is_null($concrete)) {
214
  $concrete = $abstract;
215
  }
@@ -218,6 +249,10 @@ class Container implements ArrayAccess, ContainerContract
218
  // bound into this container to the abstract type and we will just wrap it
219
  // up inside its own Closure to give us more convenience when extending.
220
  if (! $concrete instanceof Closure) {
 
 
 
 
221
  $concrete = $this->getClosure($abstract, $concrete);
222
  }
223
 
@@ -245,7 +280,9 @@ class Container implements ArrayAccess, ContainerContract
245
  return $container->build($concrete);
246
  }
247
 
248
- return $container->makeWith($concrete, $parameters);
 
 
249
  };
250
  }
251
 
@@ -263,13 +300,28 @@ class Container implements ArrayAccess, ContainerContract
263
  /**
264
  * Bind a callback to resolve with Container::call.
265
  *
266
- * @param string $method
267
  * @param \Closure $callback
268
  * @return void
269
  */
270
  public function bindMethod($method, $callback)
271
  {
272
- $this->methodBindings[$method] = $callback;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  }
274
 
275
  /**
@@ -315,7 +367,7 @@ class Container implements ArrayAccess, ContainerContract
315
  /**
316
  * Register a shared binding in the container.
317
  *
318
- * @param string|array $abstract
319
  * @param \Closure|string|null $concrete
320
  * @return void
321
  */
@@ -324,10 +376,24 @@ class Container implements ArrayAccess, ContainerContract
324
  $this->bind($abstract, $concrete, true);
325
  }
326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  /**
328
  * "Extend" an abstract type in the container.
329
  *
330
- * @param string $abstract
331
  * @param \Closure $closure
332
  * @return void
333
  *
@@ -354,8 +420,8 @@ class Container implements ArrayAccess, ContainerContract
354
  * Register an existing instance as shared in the container.
355
  *
356
  * @param string $abstract
357
- * @param mixed $instance
358
- * @return void
359
  */
360
  public function instance($abstract, $instance)
361
  {
@@ -373,6 +439,8 @@ class Container implements ArrayAccess, ContainerContract
373
  if ($isBound) {
374
  $this->rebound($abstract);
375
  }
 
 
376
  }
377
 
378
  /**
@@ -400,7 +468,7 @@ class Container implements ArrayAccess, ContainerContract
400
  * Assign a set of tags to a given binding.
401
  *
402
  * @param array|string $abstracts
403
- * @param array|mixed ...$tags
404
  * @return void
405
  */
406
  public function tag($abstracts, $tags)
@@ -422,19 +490,19 @@ class Container implements ArrayAccess, ContainerContract
422
  * Resolve all of the bindings for a given tag.
423
  *
424
  * @param string $tag
425
- * @return array
426
  */
427
  public function tagged($tag)
428
  {
429
- $results = [];
 
 
430
 
431
- if (isset($this->tags[$tag])) {
432
  foreach ($this->tags[$tag] as $abstract) {
433
- $results[] = $this->make($abstract);
434
  }
435
- }
436
-
437
- return $results;
438
  }
439
 
440
  /**
@@ -443,9 +511,15 @@ class Container implements ArrayAccess, ContainerContract
443
  * @param string $abstract
444
  * @param string $alias
445
  * @return void
 
 
446
  */
447
  public function alias($abstract, $alias)
448
  {
 
 
 
 
449
  $this->aliases[$alias] = $abstract;
450
 
451
  $this->abstractAliases[$abstract][] = $alias;
@@ -454,7 +528,7 @@ class Container implements ArrayAccess, ContainerContract
454
  /**
455
  * Bind a new callback to an abstract's rebind event.
456
  *
457
- * @param string $abstract
458
  * @param \Closure $callback
459
  * @return mixed
460
  */
@@ -471,7 +545,7 @@ class Container implements ArrayAccess, ContainerContract
471
  * Refresh an instance on the given target and method.
472
  *
473
  * @param string $abstract
474
- * @param mixed $target
475
  * @param string $method
476
  * @return mixed
477
  */
@@ -505,11 +579,7 @@ class Container implements ArrayAccess, ContainerContract
505
  */
506
  protected function getReboundCallbacks($abstract)
507
  {
508
- if (isset($this->reboundCallbacks[$abstract])) {
509
- return $this->reboundCallbacks[$abstract];
510
- }
511
-
512
- return [];
513
  }
514
 
515
  /**
@@ -530,9 +600,11 @@ class Container implements ArrayAccess, ContainerContract
530
  * Call the given Closure / class@method and inject its dependencies.
531
  *
532
  * @param callable|string $callback
533
- * @param array $parameters
534
  * @param string|null $defaultMethod
535
  * @return mixed
 
 
536
  */
537
  public function call($callback, array $parameters = [], $defaultMethod = null)
538
  {
@@ -553,42 +625,74 @@ class Container implements ArrayAccess, ContainerContract
553
  }
554
 
555
  /**
556
- * Resolve the given type with the given parameter overrides.
557
  *
558
- * @param string $abstract
559
  * @param array $parameters
560
  * @return mixed
 
 
561
  */
562
- public function makeWith($abstract, array $parameters)
563
  {
564
- return $this->resolve($abstract, $parameters);
565
  }
566
 
567
  /**
568
  * Resolve the given type from the container.
569
  *
570
- * @param string $abstract
 
571
  * @return mixed
 
 
 
 
 
 
 
 
 
 
572
  */
573
- public function make($abstract)
574
  {
575
- return $this->resolve($abstract);
 
 
 
 
 
 
 
 
576
  }
577
 
578
  /**
579
  * Resolve the given type from the container.
580
  *
581
- * @param string $abstract
582
  * @param array $parameters
 
583
  * @return mixed
 
 
 
584
  */
585
- protected function resolve($abstract, $parameters = [])
586
  {
587
  $abstract = $this->getAlias($abstract);
588
 
589
- $needsContextualBuild = ! empty($parameters) || ! is_null(
590
- $this->getContextualConcrete($abstract)
591
- );
 
 
 
 
 
 
 
592
 
593
  // If an instance of the type is currently being managed as a singleton we'll
594
  // just return an existing instance instead of instantiating new instances
@@ -599,7 +703,9 @@ class Container implements ArrayAccess, ContainerContract
599
 
600
  $this->with[] = $parameters;
601
 
602
- $concrete = $this->getConcrete($abstract);
 
 
603
 
604
  // We're ready to instantiate an instance of the concrete type registered for
605
  // the binding. This will instantiate the types, as well as resolve any of
@@ -624,7 +730,9 @@ class Container implements ArrayAccess, ContainerContract
624
  $this->instances[$abstract] = $object;
625
  }
626
 
627
- $this->fireResolvingCallbacks($abstract, $object);
 
 
628
 
629
  // Before returning, we will also set the resolved flag to "true" and pop off
630
  // the parameter overrides for this build. After those two things are done
@@ -639,15 +747,11 @@ class Container implements ArrayAccess, ContainerContract
639
  /**
640
  * Get the concrete type for a given abstract.
641
  *
642
- * @param string $abstract
643
- * @return mixed $concrete
644
  */
645
  protected function getConcrete($abstract)
646
  {
647
- if (! is_null($concrete = $this->getContextualConcrete($abstract))) {
648
- return $concrete;
649
- }
650
-
651
  // If we don't have a registered resolver or concrete for the type, we'll just
652
  // assume each type is a concrete name and will attempt to resolve it as is
653
  // since the container should be able to resolve concretes automatically.
@@ -661,8 +765,8 @@ class Container implements ArrayAccess, ContainerContract
661
  /**
662
  * Get the contextual concrete binding for the given abstract.
663
  *
664
- * @param string $abstract
665
- * @return string|null
666
  */
667
  protected function getContextualConcrete($abstract)
668
  {
@@ -687,20 +791,18 @@ class Container implements ArrayAccess, ContainerContract
687
  /**
688
  * Find the concrete binding for the given abstract in the contextual binding array.
689
  *
690
- * @param string $abstract
691
- * @return string|null
692
  */
693
  protected function findInContextualBindings($abstract)
694
  {
695
- if (isset($this->contextual[end($this->buildStack)][$abstract])) {
696
- return $this->contextual[end($this->buildStack)][$abstract];
697
- }
698
  }
699
 
700
  /**
701
  * Determine if the given concrete is buildable.
702
  *
703
- * @param mixed $concrete
704
  * @param string $abstract
705
  * @return bool
706
  */
@@ -712,10 +814,11 @@ class Container implements ArrayAccess, ContainerContract
712
  /**
713
  * Instantiate a concrete instance of the given type.
714
  *
715
- * @param string $concrete
716
  * @return mixed
717
  *
718
  * @throws \Illuminate\Contracts\Container\BindingResolutionException
 
719
  */
720
  public function build($concrete)
721
  {
@@ -726,15 +829,23 @@ class Container implements ArrayAccess, ContainerContract
726
  return $concrete($this, $this->getLastParameterOverride());
727
  }
728
 
729
- $reflector = new ReflectionClass($concrete);
 
 
 
 
730
 
731
  // If the type is not instantiable, the developer is attempting to resolve
732
- // an abstract type such as an Interface of Abstract Class and there is
733
  // no binding registered for the abstractions so we need to bail out.
734
  if (! $reflector->isInstantiable()) {
735
  return $this->notInstantiable($concrete);
736
  }
737
 
 
 
 
 
738
  $this->buildStack[] = $concrete;
739
 
740
  $constructor = $reflector->getConstructor();
@@ -753,9 +864,13 @@ class Container implements ArrayAccess, ContainerContract
753
  // Once we have all the constructor's parameters we can create each of the
754
  // dependency instances and then use the reflection instances to make a
755
  // new instance of this class, injecting the created dependencies in.
756
- $instances = $this->resolveDependencies(
757
- $dependencies
758
- );
 
 
 
 
759
 
760
  array_pop($this->buildStack);
761
 
@@ -765,15 +880,17 @@ class Container implements ArrayAccess, ContainerContract
765
  /**
766
  * Resolve all of the dependencies from the ReflectionParameters.
767
  *
768
- * @param array $dependencies
769
  * @return array
 
 
770
  */
771
  protected function resolveDependencies(array $dependencies)
772
  {
773
  $results = [];
774
 
775
  foreach ($dependencies as $dependency) {
776
- // If this dependency has a override for this particular build we will use
777
  // that instead as the value. Otherwise, we will continue with this run
778
  // of resolutions and let reflection attempt to determine the result.
779
  if ($this->hasParameterOverride($dependency)) {
@@ -785,16 +902,22 @@ class Container implements ArrayAccess, ContainerContract
785
  // If the class is null, it means the dependency is a string or some other
786
  // primitive type which we can not resolve since it is not a class and
787
  // we will just bomb out with an error since we have no-where to go.
788
- $results[] = is_null($class = $dependency->getClass())
789
  ? $this->resolvePrimitive($dependency)
790
  : $this->resolveClass($dependency);
 
 
 
 
 
 
791
  }
792
 
793
  return $results;
794
  }
795
 
796
  /**
797
- * Determine if the given dependency has a parameter override from makeWith.
798
  *
799
  * @param \ReflectionParameter $dependency
800
  * @return bool
@@ -837,7 +960,7 @@ class Container implements ArrayAccess, ContainerContract
837
  */
838
  protected function resolvePrimitive(ReflectionParameter $parameter)
839
  {
840
- if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->name))) {
841
  return $concrete instanceof Closure ? $concrete($this) : $concrete;
842
  }
843
 
@@ -859,21 +982,52 @@ class Container implements ArrayAccess, ContainerContract
859
  protected function resolveClass(ReflectionParameter $parameter)
860
  {
861
  try {
862
- return $this->make($parameter->getClass()->name);
 
 
863
  }
864
 
865
  // If we can not resolve the class instance, we will check to see if the value
866
  // is optional, and if it is we will return the optional parameter value as
867
  // the value of the dependency, similarly to how we do this with scalars.
868
  catch (BindingResolutionException $e) {
869
- if ($parameter->isOptional()) {
 
 
870
  return $parameter->getDefaultValue();
871
  }
872
 
 
 
 
 
 
 
873
  throw $e;
874
  }
875
  }
876
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
877
  /**
878
  * Throw an exception that the concrete is not instantiable.
879
  *
@@ -910,10 +1064,30 @@ class Container implements ArrayAccess, ContainerContract
910
  throw new BindingResolutionException($message);
911
  }
912
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
913
  /**
914
  * Register a new resolving callback.
915
  *
916
- * @param string $abstract
917
  * @param \Closure|null $callback
918
  * @return void
919
  */
@@ -933,8 +1107,8 @@ class Container implements ArrayAccess, ContainerContract
933
  /**
934
  * Register a new after resolving callback for all types.
935
  *
936
- * @param string $abstract
937
- * @param \Closure|null $callback
938
  * @return void
939
  */
940
  public function afterResolving($abstract, Closure $callback = null)
@@ -950,11 +1124,44 @@ class Container implements ArrayAccess, ContainerContract
950
  }
951
  }
952
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
953
  /**
954
  * Fire all of the resolving callbacks.
955
  *
956
  * @param string $abstract
957
- * @param mixed $object
958
  * @return void
959
  */
960
  protected function fireResolvingCallbacks($abstract, $object)
@@ -972,7 +1179,7 @@ class Container implements ArrayAccess, ContainerContract
972
  * Fire all of the after resolving callbacks.
973
  *
974
  * @param string $abstract
975
- * @param mixed $object
976
  * @return void
977
  */
978
  protected function fireAfterResolvingCallbacks($abstract, $object)
@@ -989,7 +1196,7 @@ class Container implements ArrayAccess, ContainerContract
989
  *
990
  * @param string $abstract
991
  * @param object $object
992
- * @param array $callbacksPerType
993
  *
994
  * @return array
995
  */
@@ -1035,20 +1242,12 @@ class Container implements ArrayAccess, ContainerContract
1035
  *
1036
  * @param string $abstract
1037
  * @return string
1038
- *
1039
- * @throws \LogicException
1040
  */
1041
  public function getAlias($abstract)
1042
  {
1043
- if (! isset($this->aliases[$abstract])) {
1044
- return $abstract;
1045
- }
1046
-
1047
- if ($this->aliases[$abstract] === $abstract) {
1048
- throw new LogicException("[{$abstract}] is aliased to itself.");
1049
- }
1050
-
1051
- return $this->getAlias($this->aliases[$abstract]);
1052
  }
1053
 
1054
  /**
@@ -1059,13 +1258,7 @@ class Container implements ArrayAccess, ContainerContract
1059
  */
1060
  protected function getExtenders($abstract)
1061
  {
1062
- $abstract = $this->getAlias($abstract);
1063
-
1064
- if (isset($this->extenders[$abstract])) {
1065
- return $this->extenders[$abstract];
1066
- }
1067
-
1068
- return [];
1069
  }
1070
 
1071
  /**
@@ -1126,7 +1319,7 @@ class Container implements ArrayAccess, ContainerContract
1126
  }
1127
 
1128
  /**
1129
- * Set the globally available instance of the container.
1130
  *
1131
  * @return static
1132
  */
@@ -1143,7 +1336,7 @@ class Container implements ArrayAccess, ContainerContract
1143
  * Set the shared instance of the container.
1144
  *
1145
  * @param \Illuminate\Contracts\Container\Container|null $container
1146
- * @return static
1147
  */
1148
  public static function setInstance(ContainerContract $container = null)
1149
  {
@@ -1176,7 +1369,7 @@ class Container implements ArrayAccess, ContainerContract
1176
  * Set the value at a given offset.
1177
  *
1178
  * @param string $key
1179
- * @param mixed $value
1180
  * @return void
1181
  */
1182
  public function offsetSet($key, $value)
@@ -1212,7 +1405,7 @@ class Container implements ArrayAccess, ContainerContract
1212
  * Dynamically set container services.
1213
  *
1214
  * @param string $key
1215
- * @param mixed $value
1216
  * @return void
1217
  */
1218
  public function __set($key, $value)
2
 
3
  namespace Illuminate\Container;
4
 
 
5
  use ArrayAccess;
6
+ use Closure;
7
+ use Exception;
8
+ use Illuminate\Contracts\Container\BindingResolutionException;
9
+ use Illuminate\Contracts\Container\CircularDependencyException;
10
+ use Illuminate\Contracts\Container\Container as ContainerContract;
11
  use LogicException;
12
  use ReflectionClass;
13
+ use ReflectionException;
14
  use ReflectionParameter;
 
 
15
 
16
  class Container implements ArrayAccess, ContainerContract
17
  {
25
  /**
26
  * An array of the types that have been resolved.
27
  *
28
+ * @var bool[]
29
  */
30
  protected $resolved = [];
31
 
32
  /**
33
  * The container's bindings.
34
  *
35
+ * @var array[]
36
  */
37
  protected $bindings = [];
38
 
39
  /**
40
  * The container's method bindings.
41
  *
42
+ * @var \Closure[]
43
  */
44
  protected $methodBindings = [];
45
 
46
  /**
47
  * The container's shared instances.
48
  *
49
+ * @var object[]
50
  */
51
  protected $instances = [];
52
 
53
  /**
54
  * The registered type aliases.
55
  *
56
+ * @var string[]
57
  */
58
  protected $aliases = [];
59
 
60
  /**
61
  * The registered aliases keyed by the abstract name.
62
  *
63
+ * @var array[]
64
  */
65
  protected $abstractAliases = [];
66
 
67
  /**
68
  * The extension closures for services.
69
  *
70
+ * @var array[]
71
  */
72
  protected $extenders = [];
73
 
74
  /**
75
  * All of the registered tags.
76
  *
77
+ * @var array[]
78
  */
79
  protected $tags = [];
80
 
81
  /**
82
  * The stack of concretions currently being built.
83
  *
84
+ * @var array[]
85
  */
86
  protected $buildStack = [];
87
 
88
  /**
89
  * The parameter override stack.
90
  *
91
+ * @var array[]
92
  */
93
  protected $with = [];
94
 
95
  /**
96
  * The contextual binding map.
97
  *
98
+ * @var array[]
99
  */
100
  public $contextual = [];
101
 
102
  /**
103
  * All of the registered rebound callbacks.
104
  *
105
+ * @var array[]
106
  */
107
  protected $reboundCallbacks = [];
108
 
109
+ /**
110
+ * All of the global before resolving callbacks.
111
+ *
112
+ * @var \Closure[]
113
+ */
114
+ protected $globalBeforeResolvingCallbacks = [];
115
+
116
  /**
117
  * All of the global resolving callbacks.
118
  *
119
+ * @var \Closure[]
120
  */
121
  protected $globalResolvingCallbacks = [];
122
 
123
  /**
124
  * All of the global after resolving callbacks.
125
  *
126
+ * @var \Closure[]
127
  */
128
  protected $globalAfterResolvingCallbacks = [];
129
 
130
+ /**
131
+ * All of the before resolving callbacks by class type.
132
+ *
133
+ * @var array[]
134
+ */
135
+ protected $beforeResolvingCallbacks = [];
136
+
137
  /**
138
  * All of the resolving callbacks by class type.
139
  *
140
+ * @var array[]
141
  */
142
  protected $resolvingCallbacks = [];
143
 
144
  /**
145
  * All of the after resolving callbacks by class type.
146
  *
147
+ * @var array[]
148
  */
149
  protected $afterResolvingCallbacks = [];
150
 
151
  /**
152
  * Define a contextual binding.
153
  *
154
+ * @param array|string $concrete
155
  * @return \Illuminate\Contracts\Container\ContextualBindingBuilder
156
  */
157
  public function when($concrete)
158
  {
159
+ $aliases = [];
160
+
161
+ foreach (Util::arrayWrap($concrete) as $c) {
162
+ $aliases[] = $this->getAlias($c);
163
+ }
164
+
165
+ return new ContextualBindingBuilder($this, $aliases);
166
  }
167
 
168
  /**
178
  $this->isAlias($abstract);
179
  }
180
 
181
+ /**
182
+ * {@inheritdoc}
183
+ */
184
+ public function has($id)
185
+ {
186
+ return $this->bound($id);
187
+ }
188
+
189
  /**
190
  * Determine if the given abstract type has been resolved.
191
  *
211
  public function isShared($abstract)
212
  {
213
  return isset($this->instances[$abstract]) ||
214
+ (isset($this->bindings[$abstract]['shared']) &&
215
  $this->bindings[$abstract]['shared'] === true);
216
  }
217
 
229
  /**
230
  * Register a binding with the container.
231
  *
232
+ * @param string $abstract
233
  * @param \Closure|string|null $concrete
234
  * @param bool $shared
235
  * @return void
236
  */
237
  public function bind($abstract, $concrete = null, $shared = false)
238
  {
239
+ $this->dropStaleInstances($abstract);
240
+
241
  // If no concrete type was given, we will simply set the concrete type to the
242
  // abstract type. After that, the concrete type to be registered as shared
243
  // without being forced to state their classes in both of the parameters.
 
 
244
  if (is_null($concrete)) {
245
  $concrete = $abstract;
246
  }
249
  // bound into this container to the abstract type and we will just wrap it
250
  // up inside its own Closure to give us more convenience when extending.
251
  if (! $concrete instanceof Closure) {
252
+ if (! is_string($concrete)) {
253
+ throw new \TypeError(self::class.'::bind(): Argument #2 ($concrete) must be of type Closure|string|null');
254
+ }
255
+
256
  $concrete = $this->getClosure($abstract, $concrete);
257
  }
258
 
280
  return $container->build($concrete);
281
  }
282
 
283
+ return $container->resolve(
284
+ $concrete, $parameters, $raiseEvents = false
285
+ );
286
  };
287
  }
288
 
300
  /**
301
  * Bind a callback to resolve with Container::call.
302
  *
303
+ * @param array|string $method
304
  * @param \Closure $callback
305
  * @return void
306
  */
307
  public function bindMethod($method, $callback)
308
  {
309
+ $this->methodBindings[$this->parseBindMethod($method)] = $callback;
310
+ }
311
+
312
+ /**
313
+ * Get the method to be bound in class@method format.
314
+ *
315
+ * @param array|string $method
316
+ * @return string
317
+ */
318
+ protected function parseBindMethod($method)
319
+ {
320
+ if (is_array($method)) {
321
+ return $method[0].'@'.$method[1];
322
+ }
323
+
324
+ return $method;
325
  }
326
 
327
  /**
367
  /**
368
  * Register a shared binding in the container.
369
  *
370
+ * @param string $abstract
371
  * @param \Closure|string|null $concrete
372
  * @return void
373
  */
376
  $this->bind($abstract, $concrete, true);
377
  }
378
 
379
+ /**
380
+ * Register a shared binding if it hasn't already been registered.
381
+ *
382
+ * @param string $abstract
383
+ * @param \Closure|string|null $concrete
384
+ * @return void
385
+ */
386
+ public function singletonIf($abstract, $concrete = null)
387
+ {
388
+ if (! $this->bound($abstract)) {
389
+ $this->singleton($abstract, $concrete);
390
+ }
391
+ }
392
+
393
  /**
394
  * "Extend" an abstract type in the container.
395
  *
396
+ * @param string $abstract
397
  * @param \Closure $closure
398
  * @return void
399
  *
420
  * Register an existing instance as shared in the container.
421
  *
422
  * @param string $abstract
423
+ * @param mixed $instance
424
+ * @return mixed
425
  */
426
  public function instance($abstract, $instance)
427
  {
439
  if ($isBound) {
440
  $this->rebound($abstract);
441
  }
442
+
443
+ return $instance;
444
  }
445
 
446
  /**
468
  * Assign a set of tags to a given binding.
469
  *
470
  * @param array|string $abstracts
471
+ * @param array|mixed ...$tags
472
  * @return void
473
  */
474
  public function tag($abstracts, $tags)
490
  * Resolve all of the bindings for a given tag.
491
  *
492
  * @param string $tag
493
+ * @return iterable
494
  */
495
  public function tagged($tag)
496
  {
497
+ if (! isset($this->tags[$tag])) {
498
+ return [];
499
+ }
500
 
501
+ return new RewindableGenerator(function () use ($tag) {
502
  foreach ($this->tags[$tag] as $abstract) {
503
+ yield $this->make($abstract);
504
  }
505
+ }, count($this->tags[$tag]));
 
 
506
  }
507
 
508
  /**
511
  * @param string $abstract
512
  * @param string $alias
513
  * @return void
514
+ *
515
+ * @throws \LogicException
516
  */
517
  public function alias($abstract, $alias)
518
  {
519
+ if ($alias === $abstract) {
520
+ throw new LogicException("[{$abstract}] is aliased to itself.");
521
+ }
522
+
523
  $this->aliases[$alias] = $abstract;
524
 
525
  $this->abstractAliases[$abstract][] = $alias;
528
  /**
529
  * Bind a new callback to an abstract's rebind event.
530
  *
531
+ * @param string $abstract
532
  * @param \Closure $callback
533
  * @return mixed
534
  */
545
  * Refresh an instance on the given target and method.
546
  *
547
  * @param string $abstract
548
+ * @param mixed $target
549
  * @param string $method
550
  * @return mixed
551
  */
579
  */
580
  protected function getReboundCallbacks($abstract)
581
  {
582
+ return $this->reboundCallbacks[$abstract] ?? [];
 
 
 
 
583
  }
584
 
585
  /**
600
  * Call the given Closure / class@method and inject its dependencies.
601
  *
602
  * @param callable|string $callback
603
+ * @param array<string, mixed> $parameters
604
  * @param string|null $defaultMethod
605
  * @return mixed
606
+ *
607
+ * @throws \InvalidArgumentException
608
  */
609
  public function call($callback, array $parameters = [], $defaultMethod = null)
610
  {
625
  }
626
 
627
  /**
628
+ * An alias function name for make().
629
  *
630
+ * @param string|callable $abstract
631
  * @param array $parameters
632
  * @return mixed
633
+ *
634
+ * @throws \Illuminate\Contracts\Container\BindingResolutionException
635
  */
636
+ public function makeWith($abstract, array $parameters = [])
637
  {
638
+ return $this->make($abstract, $parameters);
639
  }
640
 
641
  /**
642
  * Resolve the given type from the container.
643
  *
644
+ * @param string|callable $abstract
645
+ * @param array $parameters
646
  * @return mixed
647
+ *
648
+ * @throws \Illuminate\Contracts\Container\BindingResolutionException
649
+ */
650
+ public function make($abstract, array $parameters = [])
651
+ {
652
+ return $this->resolve($abstract, $parameters);
653
+ }
654
+
655
+ /**
656
+ * {@inheritdoc}
657
  */
658
+ public function get($id)
659
  {
660
+ try {
661
+ return $this->resolve($id);
662
+ } catch (Exception $e) {
663
+ if ($this->has($id) || $e instanceof CircularDependencyException) {
664
+ throw $e;
665
+ }
666
+
667
+ throw new EntryNotFoundException($id, $e->getCode(), $e);
668
+ }
669
  }
670
 
671
  /**
672
  * Resolve the given type from the container.
673
  *
674
+ * @param string|callable $abstract
675
  * @param array $parameters
676
+ * @param bool $raiseEvents
677
  * @return mixed
678
+ *
679
+ * @throws \Illuminate\Contracts\Container\BindingResolutionException
680
+ * @throws \Illuminate\Contracts\Container\CircularDependencyException
681
  */
682
+ protected function resolve($abstract, $parameters = [], $raiseEvents = true)
683
  {
684
  $abstract = $this->getAlias($abstract);
685
 
686
+ // First we'll fire any event handlers which handle the "before" resolving of
687
+ // specific types. This gives some hooks the chance to add various extends
688
+ // calls to change the resolution of objects that they're interested in.
689
+ if ($raiseEvents) {
690
+ $this->fireBeforeResolvingCallbacks($abstract, $parameters);
691
+ }
692
+
693
+ $concrete = $this->getContextualConcrete($abstract);
694
+
695
+ $needsContextualBuild = ! empty($parameters) || ! is_null($concrete);
696
 
697
  // If an instance of the type is currently being managed as a singleton we'll
698
  // just return an existing instance instead of instantiating new instances
703
 
704
  $this->with[] = $parameters;
705
 
706
+ if (is_null($concrete)) {
707
+ $concrete = $this->getConcrete($abstract);
708
+ }
709
 
710
  // We're ready to instantiate an instance of the concrete type registered for
711
  // the binding. This will instantiate the types, as well as resolve any of
730
  $this->instances[$abstract] = $object;
731
  }
732
 
733
+ if ($raiseEvents) {
734
+ $this->fireResolvingCallbacks($abstract, $object);
735
+ }
736
 
737
  // Before returning, we will also set the resolved flag to "true" and pop off
738
  // the parameter overrides for this build. After those two things are done
747
  /**
748
  * Get the concrete type for a given abstract.
749
  *
750
+ * @param string|callable $abstract
751
+ * @return mixed
752
  */
753
  protected function getConcrete($abstract)
754
  {
 
 
 
 
755
  // If we don't have a registered resolver or concrete for the type, we'll just
756
  // assume each type is a concrete name and will attempt to resolve it as is
757
  // since the container should be able to resolve concretes automatically.
765
  /**
766
  * Get the contextual concrete binding for the given abstract.
767
  *
768
+ * @param string|callable $abstract
769
+ * @return \Closure|string|array|null
770
  */
771
  protected function getContextualConcrete($abstract)
772
  {
791
  /**
792
  * Find the concrete binding for the given abstract in the contextual binding array.
793
  *
794
+ * @param string|callable $abstract
795
+ * @return \Closure|string|null
796
  */
797
  protected function findInContextualBindings($abstract)
798
  {
799
+ return $this->contextual[end($this->buildStack)][$abstract] ?? null;
 
 
800
  }
801
 
802
  /**
803
  * Determine if the given concrete is buildable.
804
  *
805
+ * @param mixed $concrete
806
  * @param string $abstract
807
  * @return bool
808
  */
814
  /**
815
  * Instantiate a concrete instance of the given type.
816
  *
817
+ * @param \Closure|string $concrete
818
  * @return mixed
819
  *
820
  * @throws \Illuminate\Contracts\Container\BindingResolutionException
821
+ * @throws \Illuminate\Contracts\Container\CircularDependencyException
822
  */
823
  public function build($concrete)
824
  {
829
  return $concrete($this, $this->getLastParameterOverride());
830
  }
831
 
832
+ try {
833
+ $reflector = new ReflectionClass($concrete);
834
+ } catch (ReflectionException $e) {
835
+ throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
836
+ }
837
 
838
  // If the type is not instantiable, the developer is attempting to resolve
839
+ // an abstract type such as an Interface or Abstract Class and there is
840
  // no binding registered for the abstractions so we need to bail out.
841
  if (! $reflector->isInstantiable()) {
842
  return $this->notInstantiable($concrete);
843
  }
844
 
845
+ // if (in_array($concrete, $this->buildStack)) {
846
+ // throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}].");
847
+ // }
848
+
849
  $this->buildStack[] = $concrete;
850
 
851
  $constructor = $reflector->getConstructor();
864
  // Once we have all the constructor's parameters we can create each of the
865
  // dependency instances and then use the reflection instances to make a
866
  // new instance of this class, injecting the created dependencies in.
867
+ try {
868
+ $instances = $this->resolveDependencies($dependencies);
869
+ } catch (BindingResolutionException $e) {
870
+ array_pop($this->buildStack);
871
+
872
+ throw $e;
873
+ }
874
 
875
  array_pop($this->buildStack);
876
 
880
  /**
881
  * Resolve all of the dependencies from the ReflectionParameters.
882
  *
883
+ * @param \ReflectionParameter[] $dependencies
884
  * @return array
885
+ *
886
+ * @throws \Illuminate\Contracts\Container\BindingResolutionException
887
  */
888
  protected function resolveDependencies(array $dependencies)
889
  {
890
  $results = [];
891
 
892
  foreach ($dependencies as $dependency) {
893
+ // If the dependency has an override for this particular build we will use
894
  // that instead as the value. Otherwise, we will continue with this run
895
  // of resolutions and let reflection attempt to determine the result.
896
  if ($this->hasParameterOverride($dependency)) {
902
  // If the class is null, it means the dependency is a string or some other
903
  // primitive type which we can not resolve since it is not a class and
904
  // we will just bomb out with an error since we have no-where to go.
905
+ $result = is_null(Util::getParameterClassName($dependency))
906
  ? $this->resolvePrimitive($dependency)
907
  : $this->resolveClass($dependency);
908
+
909
+ if ($dependency->isVariadic()) {
910
+ $results = array_merge($results, $result);
911
+ } else {
912
+ $results[] = $result;
913
+ }
914
  }
915
 
916
  return $results;
917
  }
918
 
919
  /**
920
+ * Determine if the given dependency has a parameter override.
921
  *
922
  * @param \ReflectionParameter $dependency
923
  * @return bool
960
  */
961
  protected function resolvePrimitive(ReflectionParameter $parameter)
962
  {
963
+ if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->getName()))) {
964
  return $concrete instanceof Closure ? $concrete($this) : $concrete;
965
  }
966
 
982
  protected function resolveClass(ReflectionParameter $parameter)
983
  {
984
  try {
985
+ return $parameter->isVariadic()
986
+ ? $this->resolveVariadicClass($parameter)
987
+ : $this->make(Util::getParameterClassName($parameter));
988
  }
989
 
990
  // If we can not resolve the class instance, we will check to see if the value
991
  // is optional, and if it is we will return the optional parameter value as
992
  // the value of the dependency, similarly to how we do this with scalars.
993
  catch (BindingResolutionException $e) {
994
+ if ($parameter->isDefaultValueAvailable()) {
995
+ array_pop($this->with);
996
+
997
  return $parameter->getDefaultValue();
998
  }
999
 
1000
+ if ($parameter->isVariadic()) {
1001
+ array_pop($this->with);
1002
+
1003
+ return [];
1004
+ }
1005
+
1006
  throw $e;
1007
  }
1008
  }
1009
 
1010
+ /**
1011
+ * Resolve a class based variadic dependency from the container.
1012
+ *
1013
+ * @param \ReflectionParameter $parameter
1014
+ * @return mixed
1015
+ */
1016
+ protected function resolveVariadicClass(ReflectionParameter $parameter)
1017
+ {
1018
+ $className = Util::getParameterClassName($parameter);
1019
+
1020
+ $abstract = $this->getAlias($className);
1021
+
1022
+ if (! is_array($concrete = $this->getContextualConcrete($abstract))) {
1023
+ return $this->make($className);
1024
+ }
1025
+
1026
+ return array_map(function ($abstract) {
1027
+ return $this->resolve($abstract);
1028
+ }, $concrete);
1029
+ }
1030
+
1031
  /**
1032
  * Throw an exception that the concrete is not instantiable.
1033
  *
1064
  throw new BindingResolutionException($message);
1065
  }
1066
 
1067
+ /**
1068
+ * Register a new before resolving callback for all types.
1069
+ *
1070
+ * @param \Closure|string $abstract
1071
+ * @param \Closure|null $callback
1072
+ * @return void
1073
+ */
1074
+ public function beforeResolving($abstract, Closure $callback = null)
1075
+ {
1076
+ if (is_string($abstract)) {
1077
+ $abstract = $this->getAlias($abstract);
1078
+ }
1079
+
1080
+ if ($abstract instanceof Closure && is_null($callback)) {
1081
+ $this->globalBeforeResolvingCallbacks[] = $abstract;
1082
+ } else {
1083
+ $this->beforeResolvingCallbacks[$abstract][] = $callback;
1084
+ }
1085
+ }
1086
+
1087
  /**
1088
  * Register a new resolving callback.
1089
  *
1090
+ * @param \Closure|string $abstract
1091
  * @param \Closure|null $callback
1092
  * @return void
1093
  */
1107
  /**
1108
  * Register a new after resolving callback for all types.
1109
  *
1110
+ * @param \Closure|string $abstract
1111
+ * @param \Closure|null $callback
1112
  * @return void
1113
  */
1114
  public function afterResolving($abstract, Closure $callback = null)
1124
  }
1125
  }
1126
 
1127
+ /**
1128
+ * Fire all of the before resolving callbacks.
1129
+ *
1130
+ * @param string $abstract
1131
+ * @param array $parameters
1132
+ * @return void
1133
+ */
1134
+ protected function fireBeforeResolvingCallbacks($abstract, $parameters = [])
1135
+ {
1136
+ $this->fireBeforeCallbackArray($abstract, $parameters, $this->globalBeforeResolvingCallbacks);
1137
+
1138
+ foreach ($this->beforeResolvingCallbacks as $type => $callbacks) {
1139
+ if ($type === $abstract || is_subclass_of($abstract, $type)) {
1140
+ $this->fireBeforeCallbackArray($abstract, $parameters, $callbacks);
1141
+ }
1142
+ }
1143
+ }
1144
+
1145
+ /**
1146
+ * Fire an array of callbacks with an object.
1147
+ *
1148
+ * @param string $abstract
1149
+ * @param array $parameters
1150
+ * @param array $callbacks
1151
+ * @return void
1152
+ */
1153
+ protected function fireBeforeCallbackArray($abstract, $parameters, array $callbacks)
1154
+ {
1155
+ foreach ($callbacks as $callback) {
1156
+ $callback($abstract, $parameters, $this);
1157
+ }
1158
+ }
1159
+
1160
  /**
1161
  * Fire all of the resolving callbacks.
1162
  *
1163
  * @param string $abstract
1164
+ * @param mixed $object
1165
  * @return void
1166
  */
1167
  protected function fireResolvingCallbacks($abstract, $object)
1179
  * Fire all of the after resolving callbacks.
1180
  *
1181
  * @param string $abstract
1182
+ * @param mixed $object
1183
  * @return void
1184
  */
1185
  protected function fireAfterResolvingCallbacks($abstract, $object)
1196
  *
1197
  * @param string $abstract
1198
  * @param object $object
1199
+ * @param array $callbacksPerType
1200
  *
1201
  * @return array
1202
  */
1242
  *
1243
  * @param string $abstract
1244
  * @return string
 
 
1245
  */
1246
  public function getAlias($abstract)
1247
  {
1248
+ return isset($this->aliases[$abstract])
1249
+ ? $this->getAlias($this->aliases[$abstract])
1250
+ : $abstract;
 
 
 
 
 
 
1251
  }
1252
 
1253
  /**
1258
  */
1259
  protected function getExtenders($abstract)
1260
  {
1261
+ return $this->extenders[$this->getAlias($abstract)] ?? [];
 
 
 
 
 
 
1262
  }
1263
 
1264
  /**
1319
  }
1320
 
1321
  /**
1322
+ * Get the globally available instance of the container.
1323
  *
1324
  * @return static
1325
  */
1336
  * Set the shared instance of the container.
1337
  *
1338
  * @param \Illuminate\Contracts\Container\Container|null $container
1339
+ * @return \Illuminate\Contracts\Container\Container|static
1340
  */
1341
  public static function setInstance(ContainerContract $container = null)
1342
  {
1369
  * Set the value at a given offset.
1370
  *
1371
  * @param string $key
1372
+ * @param mixed $value
1373
  * @return void
1374
  */
1375
  public function offsetSet($key, $value)
1405
  * Dynamically set container services.
1406
  *
1407
  * @param string $key
1408
+ * @param mixed $value
1409
  * @return void
1410
  */
1411
  public function __set($key, $value)
vendor/illuminate/container/ContextualBindingBuilder.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace Illuminate\Container;
4
 
 
5
  use Illuminate\Contracts\Container\ContextualBindingBuilder as ContextualBindingBuilderContract;
6
 
7
  class ContextualBindingBuilder implements ContextualBindingBuilderContract
@@ -9,14 +10,14 @@ class ContextualBindingBuilder implements ContextualBindingBuilderContract
9
  /**
10
  * The underlying container instance.
11
  *
12
- * @var \Illuminate\Container\Container
13
  */
14
  protected $container;
15
 
16
  /**
17
  * The concrete instance.
18
  *
19
- * @var string
20
  */
21
  protected $concrete;
22
 
@@ -30,8 +31,8 @@ class ContextualBindingBuilder implements ContextualBindingBuilderContract
30
  /**
31
  * Create a new contextual binding builder.
32
  *
33
- * @param \Illuminate\Container\Container $container
34
- * @param string $concrete
35
  * @return void
36
  */
37
  public function __construct(Container $container, $concrete)
@@ -56,13 +57,42 @@ class ContextualBindingBuilder implements ContextualBindingBuilderContract
56
  /**
57
  * Define the implementation for the contextual binding.
58
  *
59
- * @param \Closure|string $implementation
60
  * @return void
61
  */
62
  public function give($implementation)
63
  {
64
- $this->container->addContextualBinding(
65
- $this->concrete, $this->needs, $implementation
66
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
68
  }
2
 
3
  namespace Illuminate\Container;
4
 
5
+ use Illuminate\Contracts\Container\Container;
6
  use Illuminate\Contracts\Container\ContextualBindingBuilder as ContextualBindingBuilderContract;
7
 
8
  class ContextualBindingBuilder implements ContextualBindingBuilderContract
10
  /**
11
  * The underlying container instance.
12
  *
13
+ * @var \Illuminate\Contracts\Container\Container
14
  */
15
  protected $container;
16
 
17
  /**
18
  * The concrete instance.
19
  *
20
+ * @var string|array
21
  */
22
  protected $concrete;
23
 
31
  /**
32
  * Create a new contextual binding builder.
33
  *
34
+ * @param \Illuminate\Contracts\Container\Container $container
35
+ * @param string|array $concrete
36
  * @return void
37
  */
38
  public function __construct(Container $container, $concrete)
57
  /**
58
  * Define the implementation for the contextual binding.
59
  *
60
+ * @param \Closure|string|array $implementation
61
  * @return void
62
  */
63
  public function give($implementation)
64
  {
65
+ foreach (Util::arrayWrap($this->concrete) as $concrete) {
66
+ $this->container->addContextualBinding($concrete, $this->needs, $implementation);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Define tagged services to be used as the implementation for the contextual binding.
72
+ *
73
+ * @param string $tag
74
+ * @return void
75
+ */
76
+ public function giveTagged($tag)
77
+ {
78
+ $this->give(function ($container) use ($tag) {
79
+ $taggedServices = $container->tagged($tag);
80
+
81
+ return is_array($taggedServices) ? $taggedServices : iterator_to_array($taggedServices);
82
+ });
83
+ }
84
+
85
+ /**
86
+ * Specify the configuration item to bind as a primitive.
87
+ *
88
+ * @param string $key
89
+ * @param ?string $default
90
+ * @return void
91
+ */
92
+ public function giveConfig($key, $default = null)
93
+ {
94
+ $this->give(function ($container) use ($key, $default) {
95
+ return $container->get('config')->get($key, $default);
96
+ });
97
  }
98
  }
vendor/illuminate/container/EntryNotFoundException.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Container;
4
+
5
+ use Exception;
6
+ use Psr\Container\NotFoundExceptionInterface;
7
+
8
+ class EntryNotFoundException extends Exception implements NotFoundExceptionInterface
9
+ {
10
+ //
11
+ }
vendor/illuminate/container/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Taylor Otwell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
vendor/illuminate/container/RewindableGenerator.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Container;
4
+
5
+ use Countable;
6
+ use IteratorAggregate;
7
+
8
+ class RewindableGenerator implements Countable, IteratorAggregate
9
+ {
10
+ /**
11
+ * The generator callback.
12
+ *
13
+ * @var callable
14
+ */
15
+ protected $generator;
16
+
17
+ /**
18
+ * The number of tagged services.
19
+ *
20
+ * @var callable|int
21
+ */
22
+ protected $count;
23
+
24
+ /**
25
+ * Create a new generator instance.
26
+ *
27
+ * @param callable $generator
28
+ * @param callable|int $count
29
+ * @return void
30
+ */
31
+ public function __construct(callable $generator, $count)
32
+ {
33
+ $this->count = $count;
34
+ $this->generator = $generator;
35
+ }
36
+
37
+ /**
38
+ * Get an iterator from the generator.
39
+ *
40
+ * @return mixed
41
+ */
42
+ public function getIterator()
43
+ {
44
+ return ($this->generator)();
45
+ }
46
+
47
+ /**
48
+ * Get the total number of tagged services.
49
+ *
50
+ * @return int
51
+ */
52
+ public function count()
53
+ {
54
+ if (is_callable($count = $this->count)) {
55
+ $this->count = $count();
56
+ }
57
+
58
+ return $this->count;
59
+ }
60
+ }
vendor/illuminate/container/Util.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Container;
4
+
5
+ use Closure;
6
+ use ReflectionNamedType;
7
+
8
+ /**
9
+ * @internal
10
+ */
11
+ class Util
12
+ {
13
+ /**
14
+ * If the given value is not an array and not null, wrap it in one.
15
+ *
16
+ * From Arr::wrap() in Illuminate\Support.
17
+ *
18
+ * @param mixed $value
19
+ * @return array
20
+ */
21
+ public static function arrayWrap($value)
22
+ {
23
+ if (is_null($value)) {
24
+ return [];
25
+ }
26
+
27
+ return is_array($value) ? $value : [$value];
28
+ }
29
+
30
+ /**
31
+ * Return the default value of the given value.
32
+ *
33
+ * From global value() helper in Illuminate\Support.
34
+ *
35
+ * @param mixed $value
36
+ * @return mixed
37
+ */
38
+ public static function unwrapIfClosure($value)
39
+ {
40
+ return $value instanceof Closure ? $value() : $value;
41
+ }
42
+
43
+ /**
44
+ * Get the class name of the given parameter's type, if possible.
45
+ *
46
+ * From Reflector::getParameterClassName() in Illuminate\Support.
47
+ *
48
+ * @param \ReflectionParameter $parameter
49
+ * @return string|null
50
+ */
51
+ public static function getParameterClassName($parameter)
52
+ {
53
+ $type = $parameter->getType();
54
+
55
+ if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) {
56
+ return;
57
+ }
58
+
59
+ $name = $type->getName();
60
+
61
+ if (! is_null($class = $parameter->getDeclaringClass())) {
62
+ if ($name === 'self') {
63
+ return $class->getName();
64
+ }
65
+
66
+ if ($name === 'parent' && $parent = $class->getParentClass()) {
67
+ return $parent->getName();
68
+ }
69
+ }
70
+
71
+ return $name;
72
+ }
73
+ }
vendor/illuminate/container/composer.json CHANGED
@@ -14,8 +14,12 @@
14
  }
15
  ],
16
  "require": {
17
- "php": ">=5.6.4",
18
- "illuminate/contracts": "5.4.*"
 
 
 
 
19
  },
20
  "autoload": {
21
  "psr-4": {
@@ -24,7 +28,7 @@
24
  },
25
  "extra": {
26
  "branch-alias": {
27
- "dev-master": "5.4-dev"
28
  }
29
  },
30
  "config": {
14
  }
15
  ],
16
  "require": {
17
+ "php": "^7.3|^8.0",
18
+ "illuminate/contracts": "^8.0",
19
+ "psr/container": "^1.0"
20
+ },
21
+ "provide": {
22
+ "psr/container-implementation": "1.0"
23
  },
24
  "autoload": {
25
  "psr-4": {
28
  },
29
  "extra": {
30
  "branch-alias": {
31
+ "dev-master": "8.x-dev"
32
  }
33
  },
34
  "config": {
vendor/illuminate/contracts/Auth/Access/Authorizable.php CHANGED
@@ -7,9 +7,9 @@ interface Authorizable
7
  /**
8
  * Determine if the entity has a given ability.
9
  *
10
- * @param string $ability
11
  * @param array|mixed $arguments
12
  * @return bool
13
  */
14
- public function can($ability, $arguments = []);
15
  }
7
  /**
8
  * Determine if the entity has a given ability.
9
  *
10
+ * @param iterable|string $abilities
11
  * @param array|mixed $arguments
12
  * @return bool
13
  */
14
+ public function can($abilities, $arguments = []);
15
  }
vendor/illuminate/contracts/Auth/Access/Gate.php CHANGED
@@ -21,6 +21,16 @@ interface Gate
21
  */
22
  public function define($ability, $callback);
23
 
 
 
 
 
 
 
 
 
 
 
24
  /**
25
  * Define a policy class for a given class type.
26
  *
@@ -65,13 +75,22 @@ interface Gate
65
  public function denies($ability, $arguments = []);
66
 
67
  /**
68
- * Determine if the given ability should be granted.
69
  *
70
- * @param string $ability
71
  * @param array|mixed $arguments
72
  * @return bool
73
  */
74
- public function check($ability, $arguments = []);
 
 
 
 
 
 
 
 
 
75
 
76
  /**
77
  * Determine if the given ability should be granted for the current user.
@@ -84,6 +103,26 @@ interface Gate
84
  */
85
  public function authorize($ability, $arguments = []);
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  /**
88
  * Get a policy instance for a given class.
89
  *
@@ -101,4 +140,11 @@ interface Gate
101
  * @return static
102
  */
103
  public function forUser($user);
 
 
 
 
 
 
 
104
  }
21
  */
22
  public function define($ability, $callback);
23
 
24
+ /**
25
+ * Define abilities for a resource.
26
+ *
27
+ * @param string $name
28
+ * @param string $class
29
+ * @param array|null $abilities
30
+ * @return $this
31
+ */
32
+ public function resource($name, $class, array $abilities = null);
33
+
34
  /**
35
  * Define a policy class for a given class type.
36
  *
75
  public function denies($ability, $arguments = []);
76
 
77
  /**
78
+ * Determine if all of the given abilities should be granted for the current user.
79
  *
80
+ * @param iterable|string $abilities
81
  * @param array|mixed $arguments
82
  * @return bool
83
  */
84
+ public function check($abilities, $arguments = []);
85
+
86
+ /**
87
+ * Determine if any one of the given abilities should be granted for the current user.
88
+ *
89
+ * @param iterable|string $abilities
90
+ * @param array|mixed $arguments
91
+ * @return bool
92
+ */
93
+ public function any($abilities, $arguments = []);
94
 
95
  /**
96
  * Determine if the given ability should be granted for the current user.
103
  */
104
  public function authorize($ability, $arguments = []);
105
 
106
+ /**
107
+ * Inspect the user for the given ability.
108
+ *
109
+ * @param string $ability
110
+ * @param array|mixed $arguments
111
+ * @return \Illuminate\Auth\Access\Response
112
+ */
113
+ public function inspect($ability, $arguments = []);
114
+
115
+ /**
116
+ * Get the raw result from the authorization callback.
117
+ *
118
+ * @param string $ability
119
+ * @param array|mixed $arguments
120
+ * @return mixed
121
+ *
122
+ * @throws \Illuminate\Auth\Access\AuthorizationException
123
+ */
124
+ public function raw($ability, $arguments = []);
125
+
126
  /**
127
  * Get a policy instance for a given class.
128
  *
140
  * @return static
141
  */
142
  public function forUser($user);
143
+
144
+ /**
145
+ * Get all of the defined abilities.
146
+ *
147
+ * @return array
148
+ */
149
+ public function abilities();
150
  }
vendor/illuminate/contracts/Auth/Factory.php CHANGED
@@ -8,7 +8,7 @@ interface Factory
8
  * Get a guard instance by name.
9
  *
10
  * @param string|null $name
11
- * @return mixed
12
  */
13
  public function guard($name = null);
14
 
8
  * Get a guard instance by name.
9
  *
10
  * @param string|null $name
11
+ * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard
12
  */
13
  public function guard($name = null);
14
 
vendor/illuminate/contracts/Auth/Guard.php CHANGED
@@ -28,7 +28,7 @@ interface Guard
28
  /**
29
  * Get the ID for the currently authenticated user.
30
  *
31
- * @return int|null
32
  */
33
  public function id();
34
 
28
  /**
29
  * Get the ID for the currently authenticated user.
30
  *
31
+ * @return int|string|null
32
  */
33
  public function id();
34
 
vendor/illuminate/contracts/Auth/Middleware/AuthenticatesRequests.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Auth\Middleware;
4
+
5
+ interface AuthenticatesRequests
6
+ {
7
+ //
8
+ }
vendor/illuminate/contracts/Auth/MustVerifyEmail.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Auth;
4
+
5
+ interface MustVerifyEmail
6
+ {
7
+ /**
8
+ * Determine if the user has verified their email address.
9
+ *
10
+ * @return bool
11
+ */
12
+ public function hasVerifiedEmail();
13
+
14
+ /**
15
+ * Mark the given user's email as verified.
16
+ *
17
+ * @return bool
18
+ */
19
+ public function markEmailAsVerified();
20
+
21
+ /**
22
+ * Send the email verification notification.
23
+ *
24
+ * @return void
25
+ */
26
+ public function sendEmailVerificationNotification();
27
+
28
+ /**
29
+ * Get the email address that should be used for verification.
30
+ *
31
+ * @return string
32
+ */
33
+ public function getEmailForVerification();
34
+ }
vendor/illuminate/contracts/Auth/PasswordBroker.php CHANGED
@@ -28,49 +28,34 @@ interface PasswordBroker
28
  const INVALID_USER = 'passwords.user';
29
 
30
  /**
31
- * Constant representing an invalid password.
32
  *
33
  * @var string
34
  */
35
- const INVALID_PASSWORD = 'passwords.password';
36
 
37
  /**
38
- * Constant representing an invalid token.
39
  *
40
  * @var string
41
  */
42
- const INVALID_TOKEN = 'passwords.token';
43
 
44
  /**
45
  * Send a password reset link to a user.
46
  *
47
  * @param array $credentials
 
48
  * @return string
49
  */
50
- public function sendResetLink(array $credentials);
51
 
52
  /**
53
  * Reset the password for the given token.
54
  *
55
- * @param array $credentials
56
  * @param \Closure $callback
57
  * @return mixed
58
  */
59
  public function reset(array $credentials, Closure $callback);
60
-
61
- /**
62
- * Set a custom password validator.
63
- *
64
- * @param \Closure $callback
65
- * @return void
66
- */
67
- public function validator(Closure $callback);
68
-
69
- /**
70
- * Determine if the passwords match for the request.
71
- *
72
- * @param array $credentials
73
- * @return bool
74
- */
75
- public function validateNewPassword(array $credentials);
76
  }
28
  const INVALID_USER = 'passwords.user';
29
 
30
  /**
31
+ * Constant representing an invalid token.
32
  *
33
  * @var string
34
  */
35
+ const INVALID_TOKEN = 'passwords.token';
36
 
37
  /**
38
+ * Constant representing a throttled reset attempt.
39
  *
40
  * @var string
41
  */
42
+ const RESET_THROTTLED = 'passwords.throttled';
43
 
44
  /**
45
  * Send a password reset link to a user.
46
  *
47
  * @param array $credentials
48
+ * @param \Closure|null $callback
49
  * @return string
50
  */
51
+ public function sendResetLink(array $credentials, Closure $callback = null);
52
 
53
  /**
54
  * Reset the password for the given token.
55
  *
56
+ * @param array $credentials
57
  * @param \Closure $callback
58
  * @return mixed
59
  */
60
  public function reset(array $credentials, Closure $callback);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
vendor/illuminate/contracts/Auth/StatefulGuard.php CHANGED
@@ -8,7 +8,7 @@ interface StatefulGuard extends Guard
8
  * Attempt to authenticate a user using the given credentials.
9
  *
10
  * @param array $credentials
11
- * @param bool $remember
12
  * @return bool
13
  */
14
  public function attempt(array $credentials = [], $remember = false);
@@ -34,8 +34,8 @@ interface StatefulGuard extends Guard
34
  * Log the given user ID into the application.
35
  *
36
  * @param mixed $id
37
- * @param bool $remember
38
- * @return \Illuminate\Contracts\Auth\Authenticatable
39
  */
40
  public function loginUsingId($id, $remember = false);
41
 
@@ -43,7 +43,7 @@ interface StatefulGuard extends Guard
43
  * Log the given user ID into the application without sessions or cookies.
44
  *
45
  * @param mixed $id
46
- * @return bool
47
  */
48
  public function onceUsingId($id);
49
 
8
  * Attempt to authenticate a user using the given credentials.
9
  *
10
  * @param array $credentials
11
+ * @param bool $remember
12
  * @return bool
13
  */
14
  public function attempt(array $credentials = [], $remember = false);
34
  * Log the given user ID into the application.
35
  *
36
  * @param mixed $id
37
+ * @param bool $remember
38
+ * @return \Illuminate\Contracts\Auth\Authenticatable|bool
39
  */
40
  public function loginUsingId($id, $remember = false);
41
 
43
  * Log the given user ID into the application without sessions or cookies.
44
  *
45
  * @param mixed $id
46
+ * @return \Illuminate\Contracts\Auth\Authenticatable|bool
47
  */
48
  public function onceUsingId($id);
49
 
vendor/illuminate/contracts/Auth/UserProvider.php CHANGED
@@ -15,7 +15,7 @@ interface UserProvider
15
  /**
16
  * Retrieve a user by their unique identifier and "remember me" token.
17
  *
18
- * @param mixed $identifier
19
  * @param string $token
20
  * @return \Illuminate\Contracts\Auth\Authenticatable|null
21
  */
15
  /**
16
  * Retrieve a user by their unique identifier and "remember me" token.
17
  *
18
+ * @param mixed $identifier
19
  * @param string $token
20
  * @return \Illuminate\Contracts\Auth\Authenticatable|null
21
  */
vendor/illuminate/contracts/Broadcasting/Factory.php CHANGED
@@ -7,8 +7,8 @@ interface Factory
7
  /**
8
  * Get a broadcaster implementation by name.
9
  *
10
- * @param string $name
11
- * @return void
12
  */
13
  public function connection($name = null);
14
  }
7
  /**
8
  * Get a broadcaster implementation by name.
9
  *
10
+ * @param string|null $name
11
+ * @return \Illuminate\Contracts\Broadcasting\Broadcaster
12
  */
13
  public function connection($name = null);
14
  }
vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php CHANGED
@@ -7,7 +7,7 @@ interface ShouldBroadcast
7
  /**
8
  * Get the channels the event should broadcast on.
9
  *
10
- * @return array
11
  */
12
  public function broadcastOn();
13
  }
7
  /**
8
  * Get the channels the event should broadcast on.
9
  *
10
+ * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]
11
  */
12
  public function broadcastOn();
13
  }
vendor/illuminate/contracts/Bus/Dispatcher.php CHANGED
@@ -12,6 +12,17 @@ interface Dispatcher
12
  */
13
  public function dispatch($command);
14
 
 
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * Dispatch a command to its appropriate handler in the current process.
17
  *
@@ -21,6 +32,22 @@ interface Dispatcher
21
  */
22
  public function dispatchNow($command, $handler = null);
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  /**
25
  * Set the pipes commands should be piped through before dispatching.
26
  *
@@ -28,4 +55,12 @@ interface Dispatcher
28
  * @return $this
29
  */
30
  public function pipeThrough(array $pipes);
 
 
 
 
 
 
 
 
31
  }
12
  */
13
  public function dispatch($command);
14
 
15
+ /**
16
+ * Dispatch a command to its appropriate handler in the current process.
17
+ *
18
+ * Queueable jobs will be dispatched to the "sync" queue.
19
+ *
20
+ * @param mixed $command
21
+ * @param mixed $handler
22
+ * @return mixed
23
+ */
24
+ public function dispatchSync($command, $handler = null);
25
+
26
  /**
27
  * Dispatch a command to its appropriate handler in the current process.
28
  *
32
  */
33
  public function dispatchNow($command, $handler = null);
34
 
35
+ /**
36
+ * Determine if the given command has a handler.
37
+ *
38
+ * @param mixed $command
39
+ * @return bool
40
+ */
41
+ public function hasCommandHandler($command);
42
+
43
+ /**
44
+ * Retrieve the handler for a command.
45
+ *
46
+ * @param mixed $command
47
+ * @return bool|mixed
48
+ */
49
+ public function getCommandHandler($command);
50
+
51
  /**
52
  * Set the pipes commands should be piped through before dispatching.
53
  *
55
  * @return $this
56
  */
57
  public function pipeThrough(array $pipes);
58
+
59
+ /**
60
+ * Map a command to a handler.
61
+ *
62
+ * @param array $map
63
+ * @return $this
64
+ */
65
+ public function map(array $map);
66
  }
vendor/illuminate/contracts/Bus/QueueingDispatcher.php CHANGED
@@ -4,6 +4,22 @@ namespace Illuminate\Contracts\Bus;
4
 
5
  interface QueueingDispatcher extends Dispatcher
6
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  /**
8
  * Dispatch a command to its appropriate handler behind a queue.
9
  *
4
 
5
  interface QueueingDispatcher extends Dispatcher
6
  {
7
+ /**
8
+ * Attempt to find the batch with the given ID.
9
+ *
10
+ * @param string $batchId
11
+ * @return \Illuminate\Bus\Batch|null
12
+ */
13
+ public function findBatch(string $batchId);
14
+
15
+ /**
16
+ * Create a new batch of queueable jobs.
17
+ *
18
+ * @param \Illuminate\Support\Collection|array $jobs
19
+ * @return \Illuminate\Bus\PendingBatch
20
+ */
21
+ public function batch($jobs);
22
+
23
  /**
24
  * Dispatch a command to its appropriate handler behind a queue.
25
  *
vendor/illuminate/contracts/Cache/Factory.php CHANGED
@@ -8,7 +8,7 @@ interface Factory
8
  * Get a cache store instance by name.
9
  *
10
  * @param string|null $name
11
- * @return mixed
12
  */
13
  public function store($name = null);
14
  }
8
  * Get a cache store instance by name.
9
  *
10
  * @param string|null $name
11
+ * @return \Illuminate\Contracts\Cache\Repository
12
  */
13
  public function store($name = null);
14
  }
vendor/illuminate/contracts/Cache/Lock.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Cache;
4
+
5
+ interface Lock
6
+ {
7
+ /**
8
+ * Attempt to acquire the lock.
9
+ *
10
+ * @param callable|null $callback
11
+ * @return mixed
12
+ */
13
+ public function get($callback = null);
14
+
15
+ /**
16
+ * Attempt to acquire the lock for the given number of seconds.
17
+ *
18
+ * @param int $seconds
19
+ * @param callable|null $callback
20
+ * @return mixed
21
+ */
22
+ public function block($seconds, $callback = null);
23
+
24
+ /**
25
+ * Release the lock.
26
+ *
27
+ * @return bool
28
+ */
29
+ public function release();
30
+
31
+ /**
32
+ * Returns the current owner of the lock.
33
+ *
34
+ * @return string
35
+ */
36
+ public function owner();
37
+
38
+ /**
39
+ * Releases this lock in disregard of ownership.
40
+ *
41
+ * @return void
42
+ */
43
+ public function forceRelease();
44
+ }
vendor/illuminate/contracts/Cache/LockProvider.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Cache;
4
+
5
+ interface LockProvider
6
+ {
7
+ /**
8
+ * Get a lock instance.
9
+ *
10
+ * @param string $name
11
+ * @param int $seconds
12
+ * @param string|null $owner
13
+ * @return \Illuminate\Contracts\Cache\Lock
14
+ */
15
+ public function lock($name, $seconds = 0, $owner = null);
16
+
17
+ /**
18
+ * Restore a lock instance using the owner identifier.
19
+ *
20
+ * @param string $name
21
+ * @param string $owner
22
+ * @return \Illuminate\Contracts\Cache\Lock
23
+ */
24
+ public function restoreLock($name, $owner);
25
+ }
vendor/illuminate/contracts/Cache/LockTimeoutException.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Cache;
4
+
5
+ use Exception;
6
+
7
+ class LockTimeoutException extends Exception
8
+ {
9
+ //
10
+ }
vendor/illuminate/contracts/Cache/Repository.php CHANGED
@@ -3,31 +3,15 @@
3
  namespace Illuminate\Contracts\Cache;
4
 
5
  use Closure;
 
6
 
7
- interface Repository
8
  {
9
- /**
10
- * Determine if an item exists in the cache.
11
- *
12
- * @param string $key
13
- * @return bool
14
- */
15
- public function has($key);
16
-
17
- /**
18
- * Retrieve an item from the cache by key.
19
- *
20
- * @param string $key
21
- * @param mixed $default
22
- * @return mixed
23
- */
24
- public function get($key, $default = null);
25
-
26
  /**
27
  * Retrieve an item from the cache and delete it.
28
  *
29
  * @param string $key
30
- * @param mixed $default
31
  * @return mixed
32
  */
33
  public function pull($key, $default = null);
@@ -36,21 +20,21 @@ interface Repository
36
  * Store an item in the cache.
37
  *
38
  * @param string $key
39
- * @param mixed $value
40
- * @param \DateTime|float|int $minutes
41
- * @return void
42
  */
43
- public function put($key, $value, $minutes);
44
 
45
  /**
46
  * Store an item in the cache if the key does not exist.
47
  *
48
  * @param string $key
49
- * @param mixed $value
50
- * @param \DateTime|float|int $minutes
51
  * @return bool
52
  */
53
- public function add($key, $value, $minutes);
54
 
55
  /**
56
  * Increment the value of an item in the cache.
@@ -74,34 +58,34 @@ interface Repository
74
  * Store an item in the cache indefinitely.
75
  *
76
  * @param string $key
77
- * @param mixed $value
78
- * @return void
79
  */
80
  public function forever($key, $value);
81
 
82
  /**
83
- * Get an item from the cache, or store the default value.
84
  *
85
  * @param string $key
86
- * @param \DateTime|float|int $minutes
87
  * @param \Closure $callback
88
  * @return mixed
89
  */
90
- public function remember($key, $minutes, Closure $callback);
91
 
92
  /**
93
- * Get an item from the cache, or store the default value forever.
94
  *
95
- * @param string $key
96
  * @param \Closure $callback
97
  * @return mixed
98
  */
99
  public function sear($key, Closure $callback);
100
 
101
  /**
102
- * Get an item from the cache, or store the default value forever.
103
  *
104
- * @param string $key
105
  * @param \Closure $callback
106
  * @return mixed
107
  */
@@ -110,8 +94,15 @@ interface Repository
110
  /**
111
  * Remove an item from the cache.
112
  *
113
- * @param string $key
114
  * @return bool
115
  */
116
  public function forget($key);
 
 
 
 
 
 
 
117
  }
3
  namespace Illuminate\Contracts\Cache;
4
 
5
  use Closure;
6
+ use Psr\SimpleCache\CacheInterface;
7
 
8
+ interface Repository extends CacheInterface
9
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Retrieve an item from the cache and delete it.
12
  *
13
  * @param string $key
14
+ * @param mixed $default
15
  * @return mixed
16
  */
17
  public function pull($key, $default = null);
20
  * Store an item in the cache.
21
  *
22
  * @param string $key
23
+ * @param mixed $value
24
+ * @param \DateTimeInterface|\DateInterval|int|null $ttl
25
+ * @return bool
26
  */
27
+ public function put($key, $value, $ttl = null);
28
 
29
  /**
30
  * Store an item in the cache if the key does not exist.
31
  *
32
  * @param string $key
33
+ * @param mixed $value
34
+ * @param \DateTimeInterface|\DateInterval|int|null $ttl
35
  * @return bool
36
  */
37
+ public function add($key, $value, $ttl = null);
38
 
39
  /**
40
  * Increment the value of an item in the cache.
58
  * Store an item in the cache indefinitely.
59
  *
60
  * @param string $key
61
+ * @param mixed $value
62
+ * @return bool
63
  */
64
  public function forever($key, $value);
65
 
66
  /**
67
+ * Get an item from the cache, or execute the given Closure and store the result.
68
  *
69
  * @param string $key
70
+ * @param \DateTimeInterface|\DateInterval|int|null $ttl
71
  * @param \Closure $callback
72
  * @return mixed
73
  */
74
+ public function remember($key, $ttl, Closure $callback);
75
 
76
  /**
77
+ * Get an item from the cache, or execute the given Closure and store the result forever.
78
  *
79
+ * @param string $key
80
  * @param \Closure $callback
81
  * @return mixed
82
  */
83
  public function sear($key, Closure $callback);
84
 
85
  /**
86
+ * Get an item from the cache, or execute the given Closure and store the result forever.
87
  *
88
+ * @param string $key
89
  * @param \Closure $callback
90
  * @return mixed
91
  */
94
  /**
95
  * Remove an item from the cache.
96
  *
97
+ * @param string $key
98
  * @return bool
99
  */
100
  public function forget($key);
101
+
102
+ /**
103
+ * Get the cache store implementation.
104
+ *
105
+ * @return \Illuminate\Contracts\Cache\Store
106
+ */
107
+ public function getStore();
108
  }
vendor/illuminate/contracts/Cache/Store.php CHANGED
@@ -23,29 +23,29 @@ interface Store
23
  public function many(array $keys);
24
 
25
  /**
26
- * Store an item in the cache for a given number of minutes.
27
  *
28
  * @param string $key
29
- * @param mixed $value
30
- * @param float|int $minutes
31
- * @return void
32
  */
33
- public function put($key, $value, $minutes);
34
 
35
  /**
36
- * Store multiple items in the cache for a given number of minutes.
37
  *
38
  * @param array $values
39
- * @param float|int $minutes
40
- * @return void
41
  */
42
- public function putMany(array $values, $minutes);
43
 
44
  /**
45
  * Increment the value of an item in the cache.
46
  *
47
  * @param string $key
48
- * @param mixed $value
49
  * @return int|bool
50
  */
51
  public function increment($key, $value = 1);
@@ -54,7 +54,7 @@ interface Store
54
  * Decrement the value of an item in the cache.
55
  *
56
  * @param string $key
57
- * @param mixed $value
58
  * @return int|bool
59
  */
60
  public function decrement($key, $value = 1);
@@ -63,8 +63,8 @@ interface Store
63
  * Store an item in the cache indefinitely.
64
  *
65
  * @param string $key
66
- * @param mixed $value
67
- * @return void
68
  */
69
  public function forever($key, $value);
70
 
23
  public function many(array $keys);
24
 
25
  /**
26
+ * Store an item in the cache for a given number of seconds.
27
  *
28
  * @param string $key
29
+ * @param mixed $value
30
+ * @param int $seconds
31
+ * @return bool
32
  */
33
+ public function put($key, $value, $seconds);
34
 
35
  /**
36
+ * Store multiple items in the cache for a given number of seconds.
37
  *
38
  * @param array $values
39
+ * @param int $seconds
40
+ * @return bool
41
  */
42
+ public function putMany(array $values, $seconds);
43
 
44
  /**
45
  * Increment the value of an item in the cache.
46
  *
47
  * @param string $key
48
+ * @param mixed $value
49
  * @return int|bool
50
  */
51
  public function increment($key, $value = 1);
54
  * Decrement the value of an item in the cache.
55
  *
56
  * @param string $key
57
+ * @param mixed $value
58
  * @return int|bool
59
  */
60
  public function decrement($key, $value = 1);
63
  * Store an item in the cache indefinitely.
64
  *
65
  * @param string $key
66
+ * @param mixed $value
67
+ * @return bool
68
  */
69
  public function forever($key, $value);
70
 
vendor/illuminate/contracts/Config/Repository.php CHANGED
@@ -15,8 +15,8 @@ interface Repository
15
  /**
16
  * Get the specified configuration value.
17
  *
18
- * @param string $key
19
- * @param mixed $default
20
  * @return mixed
21
  */
22
  public function get($key, $default = null);
@@ -32,7 +32,7 @@ interface Repository
32
  * Set a given configuration value.
33
  *
34
  * @param array|string $key
35
- * @param mixed $value
36
  * @return void
37
  */
38
  public function set($key, $value = null);
15
  /**
16
  * Get the specified configuration value.
17
  *
18
+ * @param array|string $key
19
+ * @param mixed $default
20
  * @return mixed
21
  */
22
  public function get($key, $default = null);
32
  * Set a given configuration value.
33
  *
34
  * @param array|string $key
35
+ * @param mixed $value
36
  * @return void
37
  */
38
  public function set($key, $value = null);
vendor/illuminate/contracts/Console/Application.php CHANGED
@@ -5,13 +5,14 @@ namespace Illuminate\Contracts\Console;
5
  interface Application
6
  {
7
  /**
8
- * Call a console application command.
9
  *
10
  * @param string $command
11
  * @param array $parameters
 
12
  * @return int
13
  */
14
- public function call($command, array $parameters = []);
15
 
16
  /**
17
  * Get the output from the last command.
5
  interface Application
6
  {
7
  /**
8
+ * Run an Artisan console command by name.
9
  *
10
  * @param string $command
11
  * @param array $parameters
12
+ * @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer
13
  * @return int
14
  */
15
+ public function call($command, array $parameters = [], $outputBuffer = null);
16
 
17
  /**
18
  * Get the output from the last command.
vendor/illuminate/contracts/Console/Kernel.php CHANGED
@@ -4,11 +4,18 @@ namespace Illuminate\Contracts\Console;
4
 
5
  interface Kernel
6
  {
 
 
 
 
 
 
 
7
  /**
8
  * Handle an incoming console command.
9
  *
10
  * @param \Symfony\Component\Console\Input\InputInterface $input
11
- * @param \Symfony\Component\Console\Output\OutputInterface $output
12
  * @return int
13
  */
14
  public function handle($input, $output = null);
@@ -18,9 +25,10 @@ interface Kernel
18
  *
19
  * @param string $command
20
  * @param array $parameters
 
21
  * @return int
22
  */
23
- public function call($command, array $parameters = []);
24
 
25
  /**
26
  * Queue an Artisan console command by name.
@@ -44,4 +52,13 @@ interface Kernel
44
  * @return string
45
  */
46
  public function output();
 
 
 
 
 
 
 
 
 
47
  }
4
 
5
  interface Kernel
6
  {
7
+ /**
8
+ * Bootstrap the application for artisan commands.
9
+ *
10
+ * @return void
11
+ */
12
+ public function bootstrap();
13
+
14
  /**
15
  * Handle an incoming console command.
16
  *
17
  * @param \Symfony\Component\Console\Input\InputInterface $input
18
+ * @param \Symfony\Component\Console\Output\OutputInterface|null $output
19
  * @return int
20
  */
21
  public function handle($input, $output = null);
25
  *
26
  * @param string $command
27
  * @param array $parameters
28
+ * @param \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer
29
  * @return int
30
  */
31
+ public function call($command, array $parameters = [], $outputBuffer = null);
32
 
33
  /**
34
  * Queue an Artisan console command by name.
52
  * @return string
53
  */
54
  public function output();
55
+
56
+ /**
57
+ * Terminate the application.
58
+ *
59
+ * @param \Symfony\Component\Console\Input\InputInterface $input
60
+ * @param int $status
61
+ * @return void
62
+ */
63
+ public function terminate($input, $status);
64
  }
vendor/illuminate/contracts/Container/BindingResolutionException.php CHANGED
@@ -3,8 +3,9 @@
3
  namespace Illuminate\Contracts\Container;
4
 
5
  use Exception;
 
6
 
7
- class BindingResolutionException extends Exception
8
  {
9
  //
10
  }
3
  namespace Illuminate\Contracts\Container;
4
 
5
  use Exception;
6
+ use Psr\Container\ContainerExceptionInterface;
7
 
8
+ class BindingResolutionException extends Exception implements ContainerExceptionInterface
9
  {
10
  //
11
  }
vendor/illuminate/contracts/Container/CircularDependencyException.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Container;
4
+
5
+ use Exception;
6
+ use Psr\Container\ContainerExceptionInterface;
7
+
8
+ class CircularDependencyException extends Exception implements ContainerExceptionInterface
9
+ {
10
+ //
11
+ }
vendor/illuminate/contracts/Container/Container.php CHANGED
@@ -3,8 +3,9 @@
3
  namespace Illuminate\Contracts\Container;
4
 
5
  use Closure;
 
6
 
7
- interface Container
8
  {
9
  /**
10
  * Determine if the given abstract type has been bound.
@@ -20,6 +21,8 @@ interface Container
20
  * @param string $abstract
21
  * @param string $alias
22
  * @return void
 
 
23
  */
24
  public function alias($abstract, $alias);
25
 
@@ -27,7 +30,7 @@ interface Container
27
  * Assign a set of tags to a given binding.
28
  *
29
  * @param array|string $abstracts
30
- * @param array|mixed ...$tags
31
  * @return void
32
  */
33
  public function tag($abstracts, $tags);
@@ -35,15 +38,15 @@ interface Container
35
  /**
36
  * Resolve all of the bindings for a given tag.
37
  *
38
- * @param array $tag
39
- * @return array
40
  */
41
  public function tagged($tag);
42
 
43
  /**
44
  * Register a binding with the container.
45
  *
46
- * @param string|array $abstract
47
  * @param \Closure|string|null $concrete
48
  * @param bool $shared
49
  * @return void
@@ -63,16 +66,25 @@ interface Container
63
  /**
64
  * Register a shared binding in the container.
65
  *
66
- * @param string|array $abstract
67
  * @param \Closure|string|null $concrete
68
  * @return void
69
  */
70
  public function singleton($abstract, $concrete = null);
71
 
 
 
 
 
 
 
 
 
 
72
  /**
73
  * "Extend" an abstract type in the container.
74
  *
75
- * @param string $abstract
76
  * @param \Closure $closure
77
  * @return void
78
  *
@@ -84,15 +96,25 @@ interface Container
84
  * Register an existing instance as shared in the container.
85
  *
86
  * @param string $abstract
87
- * @param mixed $instance
88
- * @return void
89
  */
90
  public function instance($abstract, $instance);
91
 
92
  /**
93
- * Define a contextual binding.
94
  *
95
  * @param string $concrete
 
 
 
 
 
 
 
 
 
 
96
  * @return \Illuminate\Contracts\Container\ContextualBindingBuilder
97
  */
98
  public function when($concrete);
@@ -105,13 +127,23 @@ interface Container
105
  */
106
  public function factory($abstract);
107
 
 
 
 
 
 
 
 
108
  /**
109
  * Resolve the given type from the container.
110
  *
111
  * @param string $abstract
 
112
  * @return mixed
 
 
113
  */
114
- public function make($abstract);
115
 
116
  /**
117
  * Call the given Closure / class@method and inject its dependencies.
@@ -126,7 +158,7 @@ interface Container
126
  /**
127
  * Determine if the given abstract type has been resolved.
128
  *
129
- * @param string $abstract
130
  * @return bool
131
  */
132
  public function resolved($abstract);
@@ -134,7 +166,7 @@ interface Container
134
  /**
135
  * Register a new resolving callback.
136
  *
137
- * @param string $abstract
138
  * @param \Closure|null $callback
139
  * @return void
140
  */
@@ -143,7 +175,7 @@ interface Container
143
  /**
144
  * Register a new after resolving callback.
145
  *
146
- * @param string $abstract
147
  * @param \Closure|null $callback
148
  * @return void
149
  */
3
  namespace Illuminate\Contracts\Container;
4
 
5
  use Closure;
6
+ use Psr\Container\ContainerInterface;
7
 
8
+ interface Container extends ContainerInterface
9
  {
10
  /**
11
  * Determine if the given abstract type has been bound.
21
  * @param string $abstract
22
  * @param string $alias
23
  * @return void
24
+ *
25
+ * @throws \LogicException
26
  */
27
  public function alias($abstract, $alias);
28
 
30
  * Assign a set of tags to a given binding.
31
  *
32
  * @param array|string $abstracts
33
+ * @param array|mixed ...$tags
34
  * @return void
35
  */
36
  public function tag($abstracts, $tags);
38
  /**
39
  * Resolve all of the bindings for a given tag.
40
  *
41
+ * @param string $tag
42
+ * @return iterable
43
  */
44
  public function tagged($tag);
45
 
46
  /**
47
  * Register a binding with the container.
48
  *
49
+ * @param string $abstract
50
  * @param \Closure|string|null $concrete
51
  * @param bool $shared
52
  * @return void
66
  /**
67
  * Register a shared binding in the container.
68
  *
69
+ * @param string $abstract
70
  * @param \Closure|string|null $concrete
71
  * @return void
72
  */
73
  public function singleton($abstract, $concrete = null);
74
 
75
+ /**
76
+ * Register a shared binding if it hasn't already been registered.
77
+ *
78
+ * @param string $abstract
79
+ * @param \Closure|string|null $concrete
80
+ * @return void
81
+ */
82
+ public function singletonIf($abstract, $concrete = null);
83
+
84
  /**
85
  * "Extend" an abstract type in the container.
86
  *
87
+ * @param string $abstract
88
  * @param \Closure $closure
89
  * @return void
90
  *
96
  * Register an existing instance as shared in the container.
97
  *
98
  * @param string $abstract
99
+ * @param mixed $instance
100
+ * @return mixed
101
  */
102
  public function instance($abstract, $instance);
103
 
104
  /**
105
+ * Add a contextual binding to the container.
106
  *
107
  * @param string $concrete
108
+ * @param string $abstract
109
+ * @param \Closure|string $implementation
110
+ * @return void
111
+ */
112
+ public function addContextualBinding($concrete, $abstract, $implementation);
113
+
114
+ /**
115
+ * Define a contextual binding.
116
+ *
117
+ * @param string|array $concrete
118
  * @return \Illuminate\Contracts\Container\ContextualBindingBuilder
119
  */
120
  public function when($concrete);
127
  */
128
  public function factory($abstract);
129
 
130
+ /**
131
+ * Flush the container of all bindings and resolved instances.
132
+ *
133
+ * @return void
134
+ */
135
+ public function flush();
136
+
137
  /**
138
  * Resolve the given type from the container.
139
  *
140
  * @param string $abstract
141
+ * @param array $parameters
142
  * @return mixed
143
+ *
144
+ * @throws \Illuminate\Contracts\Container\BindingResolutionException
145
  */
146
+ public function make($abstract, array $parameters = []);
147
 
148
  /**
149
  * Call the given Closure / class@method and inject its dependencies.
158
  /**
159
  * Determine if the given abstract type has been resolved.
160
  *
161
+ * @param string $abstract
162
  * @return bool
163
  */
164
  public function resolved($abstract);
166
  /**
167
  * Register a new resolving callback.
168
  *
169
+ * @param \Closure|string $abstract
170
  * @param \Closure|null $callback
171
  * @return void
172
  */
175
  /**
176
  * Register a new after resolving callback.
177
  *
178
+ * @param \Closure|string $abstract
179
  * @param \Closure|null $callback
180
  * @return void
181
  */
vendor/illuminate/contracts/Container/ContextualBindingBuilder.php CHANGED
@@ -19,4 +19,12 @@ interface ContextualBindingBuilder
19
  * @return void
20
  */
21
  public function give($implementation);
 
 
 
 
 
 
 
 
22
  }
19
  * @return void
20
  */
21
  public function give($implementation);
22
+
23
+ /**
24
+ * Define tagged services to be used as the implementation for the contextual binding.
25
+ *
26
+ * @param string $tag
27
+ * @return void
28
+ */
29
+ public function giveTagged($tag);
30
  }
vendor/illuminate/contracts/Cookie/Factory.php CHANGED
@@ -9,34 +9,38 @@ interface Factory
9
  *
10
  * @param string $name
11
  * @param string $value
12
- * @param int $minutes
13
- * @param string $path
14
- * @param string $domain
15
- * @param bool $secure
16
- * @param bool $httpOnly
 
 
17
  * @return \Symfony\Component\HttpFoundation\Cookie
18
  */
19
- public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true);
20
 
21
  /**
22
  * Create a cookie that lasts "forever" (five years).
23
  *
24
  * @param string $name
25
  * @param string $value
26
- * @param string $path
27
- * @param string $domain
28
- * @param bool $secure
29
- * @param bool $httpOnly
 
 
30
  * @return \Symfony\Component\HttpFoundation\Cookie
31
  */
32
- public function forever($name, $value, $path = null, $domain = null, $secure = false, $httpOnly = true);
33
 
34
  /**
35
  * Expire the given cookie.
36
  *
37
  * @param string $name
38
- * @param string $path
39
- * @param string $domain
40
  * @return \Symfony\Component\HttpFoundation\Cookie
41
  */
42
  public function forget($name, $path = null, $domain = null);
9
  *
10
  * @param string $name
11
  * @param string $value
12
+ * @param int $minutes
13
+ * @param string|null $path
14
+ * @param string|null $domain
15
+ * @param bool|null $secure
16
+ * @param bool $httpOnly
17
+ * @param bool $raw
18
+ * @param string|null $sameSite
19
  * @return \Symfony\Component\HttpFoundation\Cookie
20
  */
21
+ public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null);
22
 
23
  /**
24
  * Create a cookie that lasts "forever" (five years).
25
  *
26
  * @param string $name
27
  * @param string $value
28
+ * @param string|null $path
29
+ * @param string|null $domain
30
+ * @param bool|null $secure
31
+ * @param bool $httpOnly
32
+ * @param bool $raw
33
+ * @param string|null $sameSite
34
  * @return \Symfony\Component\HttpFoundation\Cookie
35
  */
36
+ public function forever($name, $value, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null);
37
 
38
  /**
39
  * Expire the given cookie.
40
  *
41
  * @param string $name
42
+ * @param string|null $path
43
+ * @param string|null $domain
44
  * @return \Symfony\Component\HttpFoundation\Cookie
45
  */
46
  public function forget($name, $path = null, $domain = null);
vendor/illuminate/contracts/Cookie/QueueingFactory.php CHANGED
@@ -16,8 +16,10 @@ interface QueueingFactory extends Factory
16
  * Remove a cookie from the queue.
17
  *
18
  * @param string $name
 
 
19
  */
20
- public function unqueue($name);
21
 
22
  /**
23
  * Get the cookies which have been queued for the next request.
16
  * Remove a cookie from the queue.
17
  *
18
  * @param string $name
19
+ * @param string|null $path
20
+ * @return void
21
  */
22
+ public function unqueue($name, $path = null);
23
 
24
  /**
25
  * Get the cookies which have been queued for the next request.
vendor/illuminate/contracts/Database/Eloquent/Castable.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Database\Eloquent;
4
+
5
+ interface Castable
6
+ {
7
+ /**
8
+ * Get the name of the caster class to use when casting from / to this cast target.
9
+ *
10
+ * @param array $arguments
11
+ * @return string
12
+ * @return string|\Illuminate\Contracts\Database\Eloquent\CastsAttributes|\Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes
13
+ */
14
+ public static function castUsing(array $arguments);
15
+ }
vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Database\Eloquent;
4
+
5
+ interface CastsAttributes
6
+ {
7
+ /**
8
+ * Transform the attribute from the underlying model values.
9
+ *
10
+ * @param \Illuminate\Database\Eloquent\Model $model
11
+ * @param string $key
12
+ * @param mixed $value
13
+ * @param array $attributes
14
+ * @return mixed
15
+ */
16
+ public function get($model, string $key, $value, array $attributes);
17
+
18
+ /**
19
+ * Transform the attribute to its underlying model values.
20
+ *
21
+ * @param \Illuminate\Database\Eloquent\Model $model
22
+ * @param string $key
23
+ * @param mixed $value
24
+ * @param array $attributes
25
+ * @return mixed
26
+ */
27
+ public function set($model, string $key, $value, array $attributes);
28
+ }
vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Database\Eloquent;
4
+
5
+ interface CastsInboundAttributes
6
+ {
7
+ /**
8
+ * Transform the attribute to its underlying model values.
9
+ *
10
+ * @param \Illuminate\Database\Eloquent\Model $model
11
+ * @param string $key
12
+ * @param mixed $value
13
+ * @param array $attributes
14
+ * @return mixed
15
+ */
16
+ public function set($model, string $key, $value, array $attributes);
17
+ }
vendor/illuminate/contracts/Database/Eloquent/DeviatesCastableAttributes.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Database\Eloquent;
4
+
5
+ interface DeviatesCastableAttributes
6
+ {
7
+ /**
8
+ * Increment the attribute.
9
+ *
10
+ * @param \Illuminate\Database\Eloquent\Model $model
11
+ * @param string $key
12
+ * @param mixed $value
13
+ * @param array $attributes
14
+ * @return mixed
15
+ */
16
+ public function increment($model, string $key, $value, array $attributes);
17
+
18
+ /**
19
+ * Decrement the attribute.
20
+ *
21
+ * @param \Illuminate\Database\Eloquent\Model $model
22
+ * @param string $key
23
+ * @param mixed $value
24
+ * @param array $attributes
25
+ * @return mixed
26
+ */
27
+ public function decrement($model, string $key, $value, array $attributes);
28
+ }
vendor/illuminate/contracts/Database/Eloquent/SerializesCastableAttributes.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Database\Eloquent;
4
+
5
+ interface SerializesCastableAttributes
6
+ {
7
+ /**
8
+ * Serialize the attribute when converting the model to an array.
9
+ *
10
+ * @param \Illuminate\Database\Eloquent\Model $model
11
+ * @param string $key
12
+ * @param mixed $value
13
+ * @param array $attributes
14
+ * @return mixed
15
+ */
16
+ public function serialize($model, string $key, $value, array $attributes);
17
+ }
vendor/illuminate/contracts/Database/Events/MigrationEvent.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Database\Events;
4
+
5
+ interface MigrationEvent
6
+ {
7
+ //
8
+ }
vendor/illuminate/contracts/Database/ModelIdentifier.php CHANGED
@@ -20,16 +20,34 @@ class ModelIdentifier
20
  */
21
  public $id;
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * Create a new model identifier.
25
  *
26
  * @param string $class
27
  * @param mixed $id
 
 
28
  * @return void
29
  */
30
- public function __construct($class, $id)
31
  {
32
  $this->id = $id;
33
  $this->class = $class;
 
 
34
  }
35
  }
20
  */
21
  public $id;
22
 
23
+ /**
24
+ * The relationships loaded on the model.
25
+ *
26
+ * @var array
27
+ */
28
+ public $relations;
29
+
30
+ /**
31
+ * The connection name of the model.
32
+ *
33
+ * @var string|null
34
+ */
35
+ public $connection;
36
+
37
  /**
38
  * Create a new model identifier.
39
  *
40
  * @param string $class
41
  * @param mixed $id
42
+ * @param array $relations
43
+ * @param mixed $connection
44
  * @return void
45
  */
46
+ public function __construct($class, $id, array $relations, $connection)
47
  {
48
  $this->id = $id;
49
  $this->class = $class;
50
+ $this->relations = $relations;
51
+ $this->connection = $connection;
52
  }
53
  }
vendor/illuminate/contracts/Debug/ExceptionHandler.php CHANGED
@@ -2,33 +2,45 @@
2
 
3
  namespace Illuminate\Contracts\Debug;
4
 
5
- use Exception;
6
 
7
  interface ExceptionHandler
8
  {
9
  /**
10
  * Report or log an exception.
11
  *
12
- * @param \Exception $e
13
  * @return void
 
 
 
 
 
 
 
 
 
 
14
  */
15
- public function report(Exception $e);
16
 
17
  /**
18
  * Render an exception into an HTTP response.
19
  *
20
  * @param \Illuminate\Http\Request $request
21
- * @param \Exception $e
22
  * @return \Symfony\Component\HttpFoundation\Response
 
 
23
  */
24
- public function render($request, Exception $e);
25
 
26
  /**
27
  * Render an exception to the console.
28
  *
29
  * @param \Symfony\Component\Console\Output\OutputInterface $output
30
- * @param \Exception $e
31
  * @return void
32
  */
33
- public function renderForConsole($output, Exception $e);
34
  }
2
 
3
  namespace Illuminate\Contracts\Debug;
4
 
5
+ use Throwable;
6
 
7
  interface ExceptionHandler
8
  {
9
  /**
10
  * Report or log an exception.
11
  *
12
+ * @param \Throwable $e
13
  * @return void
14
+ *
15
+ * @throws \Throwable
16
+ */
17
+ public function report(Throwable $e);
18
+
19
+ /**
20
+ * Determine if the exception should be reported.
21
+ *
22
+ * @param \Throwable $e
23
+ * @return bool
24
  */
25
+ public function shouldReport(Throwable $e);
26
 
27
  /**
28
  * Render an exception into an HTTP response.
29
  *
30
  * @param \Illuminate\Http\Request $request
31
+ * @param \Throwable $e
32
  * @return \Symfony\Component\HttpFoundation\Response
33
+ *
34
+ * @throws \Throwable
35
  */
36
+ public function render($request, Throwable $e);
37
 
38
  /**
39
  * Render an exception to the console.
40
  *
41
  * @param \Symfony\Component\Console\Output\OutputInterface $output
42
+ * @param \Throwable $e
43
  * @return void
44
  */
45
+ public function renderForConsole($output, Throwable $e);
46
  }
vendor/illuminate/contracts/Encryption/Encrypter.php CHANGED
@@ -7,9 +7,11 @@ interface Encrypter
7
  /**
8
  * Encrypt the given value.
9
  *
10
- * @param string $value
11
  * @param bool $serialize
12
  * @return string
 
 
13
  */
14
  public function encrypt($value, $serialize = true);
15
 
@@ -18,7 +20,9 @@ interface Encrypter
18
  *
19
  * @param string $payload
20
  * @param bool $unserialize
21
- * @return string
 
 
22
  */
23
  public function decrypt($payload, $unserialize = true);
24
  }
7
  /**
8
  * Encrypt the given value.
9
  *
10
+ * @param mixed $value
11
  * @param bool $serialize
12
  * @return string
13
+ *
14
+ * @throws \Illuminate\Contracts\Encryption\EncryptException
15
  */
16
  public function encrypt($value, $serialize = true);
17
 
20
  *
21
  * @param string $payload
22
  * @param bool $unserialize
23
+ * @return mixed
24
+ *
25
+ * @throws \Illuminate\Contracts\Encryption\DecryptException
26
  */
27
  public function decrypt($payload, $unserialize = true);
28
  }
vendor/illuminate/contracts/Encryption/StringEncrypter.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Encryption;
4
+
5
+ interface StringEncrypter
6
+ {
7
+ /**
8
+ * Encrypt a string without serialization.
9
+ *
10
+ * @param string $value
11
+ * @return string
12
+ *
13
+ * @throws \Illuminate\Contracts\Encryption\EncryptException
14
+ */
15
+ public function encryptString($value);
16
+
17
+ /**
18
+ * Decrypt the given string without unserialization.
19
+ *
20
+ * @param string $payload
21
+ * @return string
22
+ *
23
+ * @throws \Illuminate\Contracts\Encryption\DecryptException
24
+ */
25
+ public function decryptString($payload);
26
+ }
vendor/illuminate/contracts/Events/Dispatcher.php CHANGED
@@ -7,11 +7,11 @@ interface Dispatcher
7
  /**
8
  * Register an event listener with the dispatcher.
9
  *
10
- * @param string|array $events
11
- * @param mixed $listener
12
  * @return void
13
  */
14
- public function listen($events, $listener);
15
 
16
  /**
17
  * Determine if a given event has listeners.
7
  /**
8
  * Register an event listener with the dispatcher.
9
  *
10
+ * @param \Closure|string|array $events
11
+ * @param \Closure|string|array|null $listener
12
  * @return void
13
  */
14
+ public function listen($events, $listener = null);
15
 
16
  /**
17
  * Determine if a given event has listeners.
vendor/illuminate/contracts/Filesystem/Factory.php CHANGED
@@ -7,7 +7,7 @@ interface Factory
7
  /**
8
  * Get a filesystem implementation.
9
  *
10
- * @param string $name
11
  * @return \Illuminate\Contracts\Filesystem\Filesystem
12
  */
13
  public function disk($name = null);
7
  /**
8
  * Get a filesystem implementation.
9
  *
10
+ * @param string|null $name
11
  * @return \Illuminate\Contracts\Filesystem\Filesystem
12
  */
13
  public function disk($name = null);
vendor/illuminate/contracts/Filesystem/FileExistsException.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Filesystem;
4
+
5
+ use Exception;
6
+
7
+ class FileExistsException extends Exception
8
+ {
9
+ //
10
+ }
vendor/illuminate/contracts/Filesystem/Filesystem.php CHANGED
@@ -36,15 +36,38 @@ interface Filesystem
36
  */
37
  public function get($path);
38
 
 
 
 
 
 
 
 
 
 
 
39
  /**
40
  * Write the contents of a file.
41
  *
42
  * @param string $path
43
  * @param string|resource $contents
44
- * @param string $visibility
 
 
 
 
 
 
 
 
 
 
45
  * @return bool
 
 
 
46
  */
47
- public function put($path, $contents, $visibility = null);
48
 
49
  /**
50
  * Get the visibility for the given path.
@@ -59,7 +82,7 @@ interface Filesystem
59
  *
60
  * @param string $path
61
  * @param string $visibility
62
- * @return void
63
  */
64
  public function setVisibility($path, $visibility);
65
 
@@ -68,7 +91,7 @@ interface Filesystem
68
  *
69
  * @param string $path
70
  * @param string $data
71
- * @return int
72
  */
73
  public function prepend($path, $data);
74
 
@@ -77,7 +100,7 @@ interface Filesystem
77
  *
78
  * @param string $path
79
  * @param string $data
80
- * @return int
81
  */
82
  public function append($path, $data);
83
 
36
  */
37
  public function get($path);
38
 
39
+ /**
40
+ * Get a resource to read the file.
41
+ *
42
+ * @param string $path
43
+ * @return resource|null The path resource or null on failure.
44
+ *
45
+ * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
46
+ */
47
+ public function readStream($path);
48
+
49
  /**
50
  * Write the contents of a file.
51
  *
52
  * @param string $path
53
  * @param string|resource $contents
54
+ * @param mixed $options
55
+ * @return bool
56
+ */
57
+ public function put($path, $contents, $options = []);
58
+
59
+ /**
60
+ * Write a new file using a stream.
61
+ *
62
+ * @param string $path
63
+ * @param resource $resource
64
+ * @param array $options
65
  * @return bool
66
+ *
67
+ * @throws \InvalidArgumentException If $resource is not a file handle.
68
+ * @throws \Illuminate\Contracts\Filesystem\FileExistsException
69
  */
70
+ public function writeStream($path, $resource, array $options = []);
71
 
72
  /**
73
  * Get the visibility for the given path.
82
  *
83
  * @param string $path
84
  * @param string $visibility
85
+ * @return bool
86
  */
87
  public function setVisibility($path, $visibility);
88
 
91
  *
92
  * @param string $path
93
  * @param string $data
94
+ * @return bool
95
  */
96
  public function prepend($path, $data);
97
 
100
  *
101
  * @param string $path
102
  * @param string $data
103
+ * @return bool
104
  */
105
  public function append($path, $data);
106
 
vendor/illuminate/contracts/Filesystem/LockTimeoutException.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Filesystem;
4
+
5
+ use Exception;
6
+
7
+ class LockTimeoutException extends Exception
8
+ {
9
+ //
10
+ }
vendor/illuminate/contracts/Foundation/Application.php CHANGED
@@ -16,16 +16,71 @@ interface Application extends Container
16
  /**
17
  * Get the base path of the Laravel installation.
18
  *
 
19
  * @return string
20
  */
21
- public function basePath();
22
 
23
  /**
24
- * Get or check the current application environment.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  *
26
  * @return string
27
  */
28
- public function environment();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  /**
31
  * Determine if the application is currently down for maintenance.
@@ -45,11 +100,10 @@ interface Application extends Container
45
  * Register a service provider with the application.
46
  *
47
  * @param \Illuminate\Support\ServiceProvider|string $provider
48
- * @param array $options
49
- * @param bool $force
50
  * @return \Illuminate\Support\ServiceProvider
51
  */
52
- public function register($provider, $options = [], $force = false);
53
 
54
  /**
55
  * Register a deferred provider and service.
@@ -60,6 +114,14 @@ interface Application extends Container
60
  */
61
  public function registerDeferredProvider($provider, $service = null);
62
 
 
 
 
 
 
 
 
 
63
  /**
64
  * Boot the application's service providers.
65
  *
@@ -70,7 +132,7 @@ interface Application extends Container
70
  /**
71
  * Register a new boot listener.
72
  *
73
- * @param mixed $callback
74
  * @return void
75
  */
76
  public function booting($callback);
@@ -78,15 +140,76 @@ interface Application extends Container
78
  /**
79
  * Register a new "booted" listener.
80
  *
81
- * @param mixed $callback
82
  * @return void
83
  */
84
  public function booted($callback);
85
 
86
  /**
87
- * Get the path to the cached services.php file.
 
 
 
 
 
 
 
 
88
  *
89
  * @return string
90
  */
91
- public function getCachedServicesPath();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
16
  /**
17
  * Get the base path of the Laravel installation.
18
  *
19
+ * @param string $path
20
  * @return string
21
  */
22
+ public function basePath($path = '');
23
 
24
  /**
25
+ * Get the path to the bootstrap directory.
26
+ *
27
+ * @param string $path Optionally, a path to append to the bootstrap path
28
+ * @return string
29
+ */
30
+ public function bootstrapPath($path = '');
31
+
32
+ /**
33
+ * Get the path to the application configuration files.
34
+ *
35
+ * @param string $path Optionally, a path to append to the config path
36
+ * @return string
37
+ */
38
+ public function configPath($path = '');
39
+
40
+ /**
41
+ * Get the path to the database directory.
42
+ *
43
+ * @param string $path Optionally, a path to append to the database path
44
+ * @return string
45
+ */
46
+ public function databasePath($path = '');
47
+
48
+ /**
49
+ * Get the path to the resources directory.
50
+ *
51
+ * @param string $path
52
+ * @return string
53
+ */
54
+ public function resourcePath($path = '');
55
+
56
+ /**
57
+ * Get the path to the storage directory.
58
  *
59
  * @return string
60
  */
61
+ public function storagePath();
62
+
63
+ /**
64
+ * Get or check the current application environment.
65
+ *
66
+ * @param string|array $environments
67
+ * @return string|bool
68
+ */
69
+ public function environment(...$environments);
70
+
71
+ /**
72
+ * Determine if the application is running in the console.
73
+ *
74
+ * @return bool
75
+ */
76
+ public function runningInConsole();
77
+
78
+ /**
79
+ * Determine if the application is running unit tests.
80
+ *
81
+ * @return bool
82
+ */
83
+ public function runningUnitTests();
84
 
85
  /**
86
  * Determine if the application is currently down for maintenance.
100
  * Register a service provider with the application.
101
  *
102
  * @param \Illuminate\Support\ServiceProvider|string $provider
103
+ * @param bool $force
 
104
  * @return \Illuminate\Support\ServiceProvider
105
  */
106
+ public function register($provider, $force = false);
107
 
108
  /**
109
  * Register a deferred provider and service.
114
  */
115
  public function registerDeferredProvider($provider, $service = null);
116
 
117
+ /**
118
+ * Resolve a service provider instance from the class name.
119
+ *
120
+ * @param string $provider
121
+ * @return \Illuminate\Support\ServiceProvider
122
+ */
123
+ public function resolveProvider($provider);
124
+
125
  /**
126
  * Boot the application's service providers.
127
  *
132
  /**
133
  * Register a new boot listener.
134
  *
135
+ * @param callable $callback
136
  * @return void
137
  */
138
  public function booting($callback);
140
  /**
141
  * Register a new "booted" listener.
142
  *
143
+ * @param callable $callback
144
  * @return void
145
  */
146
  public function booted($callback);
147
 
148
  /**
149
+ * Run the given array of bootstrap classes.
150
+ *
151
+ * @param array $bootstrappers
152
+ * @return void
153
+ */
154
+ public function bootstrapWith(array $bootstrappers);
155
+
156
+ /**
157
+ * Get the current application locale.
158
  *
159
  * @return string
160
  */
161
+ public function getLocale();
162
+
163
+ /**
164
+ * Get the application namespace.
165
+ *
166
+ * @return string
167
+ *
168
+ * @throws \RuntimeException
169
+ */
170
+ public function getNamespace();
171
+
172
+ /**
173
+ * Get the registered service provider instances if any exist.
174
+ *
175
+ * @param \Illuminate\Support\ServiceProvider|string $provider
176
+ * @return array
177
+ */
178
+ public function getProviders($provider);
179
+
180
+ /**
181
+ * Determine if the application has been bootstrapped before.
182
+ *
183
+ * @return bool
184
+ */
185
+ public function hasBeenBootstrapped();
186
+
187
+ /**
188
+ * Load and boot all of the remaining deferred providers.
189
+ *
190
+ * @return void
191
+ */
192
+ public function loadDeferredProviders();
193
+
194
+ /**
195
+ * Set the current application locale.
196
+ *
197
+ * @param string $locale
198
+ * @return void
199
+ */
200
+ public function setLocale($locale);
201
+
202
+ /**
203
+ * Determine if middleware has been disabled for the application.
204
+ *
205
+ * @return bool
206
+ */
207
+ public function shouldSkipMiddleware();
208
+
209
+ /**
210
+ * Terminate the application.
211
+ *
212
+ * @return void
213
+ */
214
+ public function terminate();
215
  }
vendor/illuminate/contracts/Foundation/CachesConfiguration.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Foundation;
4
+
5
+ interface CachesConfiguration
6
+ {
7
+ /**
8
+ * Determine if the application configuration is cached.
9
+ *
10
+ * @return bool
11
+ */
12
+ public function configurationIsCached();
13
+
14
+ /**
15
+ * Get the path to the configuration cache file.
16
+ *
17
+ * @return string
18
+ */
19
+ public function getCachedConfigPath();
20
+
21
+ /**
22
+ * Get the path to the cached services.php file.
23
+ *
24
+ * @return string
25
+ */
26
+ public function getCachedServicesPath();
27
+ }
vendor/illuminate/contracts/Foundation/CachesRoutes.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Foundation;
4
+
5
+ interface CachesRoutes
6
+ {
7
+ /**
8
+ * Determine if the application routes are cached.
9
+ *
10
+ * @return bool
11
+ */
12
+ public function routesAreCached();
13
+
14
+ /**
15
+ * Get the path to the routes cache file.
16
+ *
17
+ * @return string
18
+ */
19
+ public function getCachedRoutesPath();
20
+ }
vendor/illuminate/contracts/Hashing/Hasher.php CHANGED
@@ -4,11 +4,19 @@ namespace Illuminate\Contracts\Hashing;
4
 
5
  interface Hasher
6
  {
 
 
 
 
 
 
 
 
7
  /**
8
  * Hash the given value.
9
  *
10
  * @param string $value
11
- * @param array $options
12
  * @return string
13
  */
14
  public function make($value, array $options = []);
@@ -18,7 +26,7 @@ interface Hasher
18
  *
19
  * @param string $value
20
  * @param string $hashedValue
21
- * @param array $options
22
  * @return bool
23
  */
24
  public function check($value, $hashedValue, array $options = []);
@@ -27,7 +35,7 @@ interface Hasher
27
  * Check if the given hash has been hashed using the given options.
28
  *
29
  * @param string $hashedValue
30
- * @param array $options
31
  * @return bool
32
  */
33
  public function needsRehash($hashedValue, array $options = []);
4
 
5
  interface Hasher
6
  {
7
+ /**
8
+ * Get information about the given hashed value.
9
+ *
10
+ * @param string $hashedValue
11
+ * @return array
12
+ */
13
+ public function info($hashedValue);
14
+
15
  /**
16
  * Hash the given value.
17
  *
18
  * @param string $value
19
+ * @param array $options
20
  * @return string
21
  */
22
  public function make($value, array $options = []);
26
  *
27
  * @param string $value
28
  * @param string $hashedValue
29
+ * @param array $options
30
  * @return bool
31
  */
32
  public function check($value, $hashedValue, array $options = []);
35
  * Check if the given hash has been hashed using the given options.
36
  *
37
  * @param string $hashedValue
38
+ * @param array $options
39
  * @return bool
40
  */
41
  public function needsRehash($hashedValue, array $options = []);
vendor/illuminate/contracts/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Taylor Otwell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
vendor/illuminate/contracts/Logging/Log.php DELETED
@@ -1,98 +0,0 @@
1
- <?php
2
-
3
- namespace Illuminate\Contracts\Logging;
4
-
5
- interface Log
6
- {
7
- /**
8
- * Log an alert message to the logs.
9
- *
10
- * @param string $message
11
- * @param array $context
12
- * @return void
13
- */
14
- public function alert($message, array $context = []);
15
-
16
- /**
17
- * Log a critical message to the logs.
18
- *
19
- * @param string $message
20
- * @param array $context
21
- * @return void
22
- */
23
- public function critical($message, array $context = []);
24
-
25
- /**
26
- * Log an error message to the logs.
27
- *
28
- * @param string $message
29
- * @param array $context
30
- * @return void
31
- */
32
- public function error($message, array $context = []);
33
-
34
- /**
35
- * Log a warning message to the logs.
36
- *
37
- * @param string $message
38
- * @param array $context
39
- * @return void
40
- */
41
- public function warning($message, array $context = []);
42
-
43
- /**
44
- * Log a notice to the logs.
45
- *
46
- * @param string $message
47
- * @param array $context
48
- * @return void
49
- */
50
- public function notice($message, array $context = []);
51
-
52
- /**
53
- * Log an informational message to the logs.
54
- *
55
- * @param string $message
56
- * @param array $context
57
- * @return void
58
- */
59
- public function info($message, array $context = []);
60
-
61
- /**
62
- * Log a debug message to the logs.
63
- *
64
- * @param string $message
65
- * @param array $context
66
- * @return void
67
- */
68
- public function debug($message, array $context = []);
69
-
70
- /**
71
- * Log a message to the logs.
72
- *
73
- * @param string $level
74
- * @param string $message
75
- * @param array $context
76
- * @return void
77
- */
78
- public function log($level, $message, array $context = []);
79
-
80
- /**
81
- * Register a file log handler.
82
- *
83
- * @param string $path
84
- * @param string $level
85
- * @return void
86
- */
87
- public function useFiles($path, $level = 'debug');
88
-
89
- /**
90
- * Register a daily file log handler.
91
- *
92
- * @param string $path
93
- * @param int $days
94
- * @param string $level
95
- * @return void
96
- */
97
- public function useDailyFiles($path, $days = 0, $level = 'debug');
98
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/illuminate/contracts/Mail/Factory.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Mail;
4
+
5
+ interface Factory
6
+ {
7
+ /**
8
+ * Get a mailer instance by name.
9
+ *
10
+ * @param string|null $name
11
+ * @return \Illuminate\Contracts\Mail\Mailer
12
+ */
13
+ public function mailer($name = null);
14
+ }
vendor/illuminate/contracts/Mail/MailQueue.php CHANGED
@@ -7,23 +7,19 @@ interface MailQueue
7
  /**
8
  * Queue a new e-mail message for sending.
9
  *
10
- * @param string|array $view
11
- * @param array $data
12
- * @param \Closure|string $callback
13
- * @param string $queue
14
  * @return mixed
15
  */
16
- public function queue($view, array $data, $callback, $queue = null);
17
 
18
  /**
19
  * Queue a new e-mail message for sending after (n) seconds.
20
  *
21
- * @param int $delay
22
- * @param string|array $view
23
- * @param array $data
24
- * @param \Closure|string $callback
25
- * @param string $queue
26
  * @return mixed
27
  */
28
- public function later($delay, $view, array $data, $callback, $queue = null);
29
  }
7
  /**
8
  * Queue a new e-mail message for sending.
9
  *
10
+ * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
11
+ * @param string|null $queue
 
 
12
  * @return mixed
13
  */
14
+ public function queue($view, $queue = null);
15
 
16
  /**
17
  * Queue a new e-mail message for sending after (n) seconds.
18
  *
19
+ * @param \DateTimeInterface|\DateInterval|int $delay
20
+ * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
21
+ * @param string|null $queue
 
 
22
  * @return mixed
23
  */
24
+ public function later($delay, $view, $queue = null);
25
  }
vendor/illuminate/contracts/Mail/Mailable.php CHANGED
@@ -9,15 +9,15 @@ interface Mailable
9
  /**
10
  * Send the message using the given mailer.
11
  *
12
- * @param Mailer $mailer
13
  * @return void
14
  */
15
- public function send(Mailer $mailer);
16
 
17
  /**
18
  * Queue the given message.
19
  *
20
- * @param Queue $queue
21
  * @return mixed
22
  */
23
  public function queue(Queue $queue);
@@ -25,9 +25,52 @@ interface Mailable
25
  /**
26
  * Deliver the queued message after the given delay.
27
  *
28
- * @param \DateTime|int $delay
29
- * @param Queue $queue
30
  * @return mixed
31
  */
32
  public function later($delay, Queue $queue);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
9
  /**
10
  * Send the message using the given mailer.
11
  *
12
+ * @param \Illuminate\Contracts\Mail\Factory|\Illuminate\Contracts\Mail\Mailer $mailer
13
  * @return void
14
  */
15
+ public function send($mailer);
16
 
17
  /**
18
  * Queue the given message.
19
  *
20
+ * @param \Illuminate\Contracts\Queue\Factory $queue
21
  * @return mixed
22
  */
23
  public function queue(Queue $queue);
25
  /**
26
  * Deliver the queued message after the given delay.
27
  *
28
+ * @param \DateTimeInterface|\DateInterval|int $delay
29
+ * @param \Illuminate\Contracts\Queue\Factory $queue
30
  * @return mixed
31
  */
32
  public function later($delay, Queue $queue);
33
+
34
+ /**
35
+ * Set the recipients of the message.
36
+ *
37
+ * @param object|array|string $address
38
+ * @param string|null $name
39
+ * @return self
40
+ */
41
+ public function cc($address, $name = null);
42
+
43
+ /**
44
+ * Set the recipients of the message.
45
+ *
46
+ * @param object|array|string $address
47
+ * @param string|null $name
48
+ * @return $this
49
+ */
50
+ public function bcc($address, $name = null);
51
+
52
+ /**
53
+ * Set the recipients of the message.
54
+ *
55
+ * @param object|array|string $address
56
+ * @param string|null $name
57
+ * @return $this
58
+ */
59
+ public function to($address, $name = null);
60
+
61
+ /**
62
+ * Set the locale of the message.
63
+ *
64
+ * @param string $locale
65
+ * @return $this
66
+ */
67
+ public function locale($locale);
68
+
69
+ /**
70
+ * Set the name of the mailer that should be used to send the message.
71
+ *
72
+ * @param string $mailer
73
+ * @return $this
74
+ */
75
+ public function mailer($mailer);
76
  }
vendor/illuminate/contracts/Mail/Mailer.php CHANGED
@@ -5,20 +5,36 @@ namespace Illuminate\Contracts\Mail;
5
  interface Mailer
6
  {
7
  /**
8
- * Send a new message when only a raw text part.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  *
10
  * @param string $text
11
- * @param \Closure|string $callback
12
- * @return int
13
  */
14
  public function raw($text, $callback);
15
 
16
  /**
17
  * Send a new message using a view.
18
  *
19
- * @param string|array $view
20
  * @param array $data
21
- * @param \Closure|string $callback
22
  * @return void
23
  */
24
  public function send($view, array $data = [], $callback = null);
5
  interface Mailer
6
  {
7
  /**
8
+ * Begin the process of mailing a mailable class instance.
9
+ *
10
+ * @param mixed $users
11
+ * @return \Illuminate\Mail\PendingMail
12
+ */
13
+ public function to($users);
14
+
15
+ /**
16
+ * Begin the process of mailing a mailable class instance.
17
+ *
18
+ * @param mixed $users
19
+ * @return \Illuminate\Mail\PendingMail
20
+ */
21
+ public function bcc($users);
22
+
23
+ /**
24
+ * Send a new message with only a raw text part.
25
  *
26
  * @param string $text
27
+ * @param mixed $callback
28
+ * @return void
29
  */
30
  public function raw($text, $callback);
31
 
32
  /**
33
  * Send a new message using a view.
34
  *
35
+ * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
36
  * @param array $data
37
+ * @param \Closure|string|null $callback
38
  * @return void
39
  */
40
  public function send($view, array $data = [], $callback = null);
vendor/illuminate/contracts/Pagination/Paginator.php CHANGED
@@ -86,12 +86,19 @@ interface Paginator
86
  public function hasPages();
87
 
88
  /**
89
- * Determine if there is more items in the data store.
90
  *
91
  * @return bool
92
  */
93
  public function hasMorePages();
94
 
 
 
 
 
 
 
 
95
  /**
96
  * Determine if the list of items is empty or not.
97
  *
@@ -99,6 +106,13 @@ interface Paginator
99
  */
100
  public function isEmpty();
101
 
 
 
 
 
 
 
 
102
  /**
103
  * Render the paginator using a given view.
104
  *
86
  public function hasPages();
87
 
88
  /**
89
+ * Determine if there are more items in the data store.
90
  *
91
  * @return bool
92
  */
93
  public function hasMorePages();
94
 
95
+ /**
96
+ * Get the base path for paginator generated URLs.
97
+ *
98
+ * @return string|null
99
+ */
100
+ public function path();
101
+
102
  /**
103
  * Determine if the list of items is empty or not.
104
  *
106
  */
107
  public function isEmpty();
108
 
109
+ /**
110
+ * Determine if the list of items is not empty.
111
+ *
112
+ * @return bool
113
+ */
114
+ public function isNotEmpty();
115
+
116
  /**
117
  * Render the paginator using a given view.
118
  *
vendor/illuminate/contracts/Queue/ClearableQueue.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Queue;
4
+
5
+ interface ClearableQueue
6
+ {
7
+ /**
8
+ * Delete all of the jobs from the queue.
9
+ *
10
+ * @param string $queue
11
+ * @return int
12
+ */
13
+ public function clear($queue);
14
+ }
vendor/illuminate/contracts/Queue/Factory.php CHANGED
@@ -7,7 +7,7 @@ interface Factory
7
  /**
8
  * Resolve a queue connection instance.
9
  *
10
- * @param string $name
11
  * @return \Illuminate\Contracts\Queue\Queue
12
  */
13
  public function connection($name = null);
7
  /**
8
  * Resolve a queue connection instance.
9
  *
10
+ * @param string|null $name
11
  * @return \Illuminate\Contracts\Queue\Queue
12
  */
13
  public function connection($name = null);
vendor/illuminate/contracts/Queue/Job.php CHANGED
@@ -4,6 +4,27 @@ namespace Illuminate\Contracts\Queue;
4
 
5
  interface Job
6
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  /**
8
  * Fire the job.
9
  *
@@ -14,11 +35,20 @@ interface Job
14
  /**
15
  * Release the job back into the queue.
16
  *
17
- * @param int $delay
18
- * @return mixed
 
 
19
  */
20
  public function release($delay = 0);
21
 
 
 
 
 
 
 
 
22
  /**
23
  * Delete the job from the queue.
24
  *
@@ -48,27 +78,55 @@ interface Job
48
  public function attempts();
49
 
50
  /**
51
- * Process an exception that caused the job to fail.
52
  *
53
- * @param \Throwable $e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  * @return void
55
  */
56
- public function failed($e);
57
 
58
  /**
59
- * The number of times to attempt a job.
60
  *
61
  * @return int|null
62
  */
63
  public function maxTries();
64
 
65
  /**
66
- * The number of seconds the job can run.
 
 
 
 
 
 
 
67
  *
68
  * @return int|null
69
  */
70
  public function timeout();
71
 
 
 
 
 
 
 
 
72
  /**
73
  * Get the name of the queued job class.
74
  *
4
 
5
  interface Job
6
  {
7
+ /**
8
+ * Get the UUID of the job.
9
+ *
10
+ * @return string|null
11
+ */
12
+ public function uuid();
13
+
14
+ /**
15
+ * Get the job identifier.
16
+ *
17
+ * @return string
18
+ */
19
+ public function getJobId();
20
+
21
+ /**
22
+ * Get the decoded body of the job.
23
+ *
24
+ * @return array
25
+ */
26
+ public function payload();
27
+
28
  /**
29
  * Fire the job.
30
  *
35
  /**
36
  * Release the job back into the queue.
37
  *
38
+ * Accepts a delay specified in seconds.
39
+ *
40
+ * @param int $delay
41
+ * @return void
42
  */
43
  public function release($delay = 0);
44
 
45
+ /**
46
+ * Determine if the job was released back into the queue.
47
+ *
48
+ * @return bool
49
+ */
50
+ public function isReleased();
51
+
52
  /**
53
  * Delete the job from the queue.
54
  *
78
  public function attempts();
79
 
80
  /**
81
+ * Determine if the job has been marked as a failure.
82
  *
83
+ * @return bool
84
+ */
85
+ public function hasFailed();
86
+
87
+ /**
88
+ * Mark the job as "failed".
89
+ *
90
+ * @return void
91
+ */
92
+ public function markAsFailed();
93
+
94
+ /**
95
+ * Delete the job, call the "failed" method, and raise the failed job event.
96
+ *
97
+ * @param \Throwable|null $e
98
  * @return void
99
  */
100
+ public function fail($e = null);
101
 
102
  /**
103
+ * Get the number of times to attempt a job.
104
  *
105
  * @return int|null
106
  */
107
  public function maxTries();
108
 
109
  /**
110
+ * Get the maximum number of exceptions allowed, regardless of attempts.
111
+ *
112
+ * @return int|null
113
+ */
114
+ public function maxExceptions();
115
+
116
+ /**
117
+ * Get the number of seconds the job can run.
118
  *
119
  * @return int|null
120
  */
121
  public function timeout();
122
 
123
+ /**
124
+ * Get the timestamp indicating when the job should timeout.
125
+ *
126
+ * @return int|null
127
+ */
128
+ public function retryUntil();
129
+
130
  /**
131
  * Get the name of the queued job class.
132
  *
vendor/illuminate/contracts/Queue/Queue.php CHANGED
@@ -7,7 +7,7 @@ interface Queue
7
  /**
8
  * Get the size of the queue.
9
  *
10
- * @param string $queue
11
  * @return int
12
  */
13
  public function size($queue = null);
@@ -15,9 +15,9 @@ interface Queue
15
  /**
16
  * Push a new job onto the queue.
17
  *
18
- * @param string $job
19
- * @param mixed $data
20
- * @param string $queue
21
  * @return mixed
22
  */
23
  public function push($job, $data = '', $queue = null);
@@ -26,8 +26,8 @@ interface Queue
26
  * Push a new job onto the queue.
27
  *
28
  * @param string $queue
29
- * @param string $job
30
- * @param mixed $data
31
  * @return mixed
32
  */
33
  public function pushOn($queue, $job, $data = '');
@@ -36,8 +36,8 @@ interface Queue
36
  * Push a raw payload onto the queue.
37
  *
38
  * @param string $payload
39
- * @param string $queue
40
- * @param array $options
41
  * @return mixed
42
  */
43
  public function pushRaw($payload, $queue = null, array $options = []);
@@ -45,10 +45,10 @@ interface Queue
45
  /**
46
  * Push a new job onto the queue after a delay.
47
  *
48
- * @param \DateTime|int $delay
49
- * @param string $job
50
- * @param mixed $data
51
- * @param string $queue
52
  * @return mixed
53
  */
54
  public function later($delay, $job, $data = '', $queue = null);
@@ -57,9 +57,9 @@ interface Queue
57
  * Push a new job onto the queue after a delay.
58
  *
59
  * @param string $queue
60
- * @param \DateTime|int $delay
61
- * @param string $job
62
- * @param mixed $data
63
  * @return mixed
64
  */
65
  public function laterOn($queue, $delay, $job, $data = '');
@@ -67,9 +67,9 @@ interface Queue
67
  /**
68
  * Push an array of jobs onto the queue.
69
  *
70
- * @param array $jobs
71
- * @param mixed $data
72
- * @param string $queue
73
  * @return mixed
74
  */
75
  public function bulk($jobs, $data = '', $queue = null);
@@ -77,7 +77,7 @@ interface Queue
77
  /**
78
  * Pop the next job off of the queue.
79
  *
80
- * @param string $queue
81
  * @return \Illuminate\Contracts\Queue\Job|null
82
  */
83
  public function pop($queue = null);
7
  /**
8
  * Get the size of the queue.
9
  *
10
+ * @param string|null $queue
11
  * @return int
12
  */
13
  public function size($queue = null);
15
  /**
16
  * Push a new job onto the queue.
17
  *
18
+ * @param string|object $job
19
+ * @param mixed $data
20
+ * @param string|null $queue
21
  * @return mixed
22
  */
23
  public function push($job, $data = '', $queue = null);
26
  * Push a new job onto the queue.
27
  *
28
  * @param string $queue
29
+ * @param string|object $job
30
+ * @param mixed $data
31
  * @return mixed
32
  */
33
  public function pushOn($queue, $job, $data = '');
36
  * Push a raw payload onto the queue.
37
  *
38
  * @param string $payload
39
+ * @param string|null $queue
40
+ * @param array $options
41
  * @return mixed
42
  */
43
  public function pushRaw($payload, $queue = null, array $options = []);
45
  /**
46
  * Push a new job onto the queue after a delay.
47
  *
48
+ * @param \DateTimeInterface|\DateInterval|int $delay
49
+ * @param string|object $job
50
+ * @param mixed $data
51
+ * @param string|null $queue
52
  * @return mixed
53
  */
54
  public function later($delay, $job, $data = '', $queue = null);
57
  * Push a new job onto the queue after a delay.
58
  *
59
  * @param string $queue
60
+ * @param \DateTimeInterface|\DateInterval|int $delay
61
+ * @param string|object $job
62
+ * @param mixed $data
63
  * @return mixed
64
  */
65
  public function laterOn($queue, $delay, $job, $data = '');
67
  /**
68
  * Push an array of jobs onto the queue.
69
  *
70
+ * @param array $jobs
71
+ * @param mixed $data
72
+ * @param string|null $queue
73
  * @return mixed
74
  */
75
  public function bulk($jobs, $data = '', $queue = null);
77
  /**
78
  * Pop the next job off of the queue.
79
  *
80
+ * @param string|null $queue
81
  * @return \Illuminate\Contracts\Queue\Job|null
82
  */
83
  public function pop($queue = null);
vendor/illuminate/contracts/Queue/QueueableCollection.php CHANGED
@@ -17,4 +17,18 @@ interface QueueableCollection
17
  * @return array
18
  */
19
  public function getQueueableIds();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
17
  * @return array
18
  */
19
  public function getQueueableIds();
20
+
21
+ /**
22
+ * Get the relationships of the entities being queued.
23
+ *
24
+ * @return array
25
+ */
26
+ public function getQueueableRelations();
27
+
28
+ /**
29
+ * Get the connection of the entities being queued.
30
+ *
31
+ * @return string|null
32
+ */
33
+ public function getQueueableConnection();
34
  }
vendor/illuminate/contracts/Queue/QueueableEntity.php CHANGED
@@ -10,4 +10,18 @@ interface QueueableEntity
10
  * @return mixed
11
  */
12
  public function getQueueableId();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
10
  * @return mixed
11
  */
12
  public function getQueueableId();
13
+
14
+ /**
15
+ * Get the relationships for the entity.
16
+ *
17
+ * @return array
18
+ */
19
+ public function getQueueableRelations();
20
+
21
+ /**
22
+ * Get the connection of the entity.
23
+ *
24
+ * @return string|null
25
+ */
26
+ public function getQueueableConnection();
27
  }
vendor/illuminate/contracts/Queue/ShouldBeEncrypted.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Queue;
4
+
5
+ interface ShouldBeEncrypted
6
+ {
7
+ //
8
+ }
vendor/illuminate/contracts/Queue/ShouldBeUnique.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Queue;
4
+
5
+ interface ShouldBeUnique
6
+ {
7
+ //
8
+ }
vendor/illuminate/contracts/Queue/ShouldBeUniqueUntilProcessing.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Queue;
4
+
5
+ interface ShouldBeUniqueUntilProcessing extends ShouldBeUnique
6
+ {
7
+ //
8
+ }
vendor/illuminate/contracts/Redis/Connection.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Redis;
4
+
5
+ use Closure;
6
+
7
+ interface Connection
8
+ {
9
+ /**
10
+ * Subscribe to a set of given channels for messages.
11
+ *
12
+ * @param array|string $channels
13
+ * @param \Closure $callback
14
+ * @return void
15
+ */
16
+ public function subscribe($channels, Closure $callback);
17
+
18
+ /**
19
+ * Subscribe to a set of given channels with wildcards.
20
+ *
21
+ * @param array|string $channels
22
+ * @param \Closure $callback
23
+ * @return void
24
+ */
25
+ public function psubscribe($channels, Closure $callback);
26
+
27
+ /**
28
+ * Run a command against the Redis database.
29
+ *
30
+ * @param string $method
31
+ * @param array $parameters
32
+ * @return mixed
33
+ */
34
+ public function command($method, array $parameters = []);
35
+ }
vendor/illuminate/contracts/Redis/Connector.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Redis;
4
+
5
+ interface Connector
6
+ {
7
+ /**
8
+ * Create a connection to a Redis cluster.
9
+ *
10
+ * @param array $config
11
+ * @param array $options
12
+ * @return \Illuminate\Redis\Connections\Connection
13
+ */
14
+ public function connect(array $config, array $options);
15
+
16
+ /**
17
+ * Create a connection to a Redis instance.
18
+ *
19
+ * @param array $config
20
+ * @param array $clusterOptions
21
+ * @param array $options
22
+ * @return \Illuminate\Redis\Connections\Connection
23
+ */
24
+ public function connectToCluster(array $config, array $clusterOptions, array $options);
25
+ }
vendor/illuminate/contracts/Redis/Factory.php CHANGED
@@ -7,7 +7,7 @@ interface Factory
7
  /**
8
  * Get a Redis connection by name.
9
  *
10
- * @param string $name
11
  * @return \Illuminate\Redis\Connections\Connection
12
  */
13
  public function connection($name = null);
7
  /**
8
  * Get a Redis connection by name.
9
  *
10
+ * @param string|null $name
11
  * @return \Illuminate\Redis\Connections\Connection
12
  */
13
  public function connection($name = null);
vendor/illuminate/contracts/Redis/LimiterTimeoutException.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Redis;
4
+
5
+ use Exception;
6
+
7
+ class LimiterTimeoutException extends Exception
8
+ {
9
+ //
10
+ }
vendor/illuminate/contracts/Routing/Registrar.php CHANGED
@@ -8,7 +8,7 @@ interface Registrar
8
  * Register a new GET route with the router.
9
  *
10
  * @param string $uri
11
- * @param \Closure|array|string $action
12
  * @return \Illuminate\Routing\Route
13
  */
14
  public function get($uri, $action);
@@ -17,7 +17,7 @@ interface Registrar
17
  * Register a new POST route with the router.
18
  *
19
  * @param string $uri
20
- * @param \Closure|array|string $action
21
  * @return \Illuminate\Routing\Route
22
  */
23
  public function post($uri, $action);
@@ -26,7 +26,7 @@ interface Registrar
26
  * Register a new PUT route with the router.
27
  *
28
  * @param string $uri
29
- * @param \Closure|array|string $action
30
  * @return \Illuminate\Routing\Route
31
  */
32
  public function put($uri, $action);
@@ -35,7 +35,7 @@ interface Registrar
35
  * Register a new DELETE route with the router.
36
  *
37
  * @param string $uri
38
- * @param \Closure|array|string $action
39
  * @return \Illuminate\Routing\Route
40
  */
41
  public function delete($uri, $action);
@@ -44,7 +44,7 @@ interface Registrar
44
  * Register a new PATCH route with the router.
45
  *
46
  * @param string $uri
47
- * @param \Closure|array|string $action
48
  * @return \Illuminate\Routing\Route
49
  */
50
  public function patch($uri, $action);
@@ -53,7 +53,7 @@ interface Registrar
53
  * Register a new OPTIONS route with the router.
54
  *
55
  * @param string $uri
56
- * @param \Closure|array|string $action
57
  * @return \Illuminate\Routing\Route
58
  */
59
  public function options($uri, $action);
@@ -63,7 +63,7 @@ interface Registrar
63
  *
64
  * @param array|string $methods
65
  * @param string $uri
66
- * @param \Closure|array|string $action
67
  * @return \Illuminate\Routing\Route
68
  */
69
  public function match($methods, $uri, $action);
@@ -73,8 +73,8 @@ interface Registrar
73
  *
74
  * @param string $name
75
  * @param string $controller
76
- * @param array $options
77
- * @return void
78
  */
79
  public function resource($name, $controller, array $options = []);
80
 
8
  * Register a new GET route with the router.
9
  *
10
  * @param string $uri
11
+ * @param array|string|callable $action
12
  * @return \Illuminate\Routing\Route
13
  */
14
  public function get($uri, $action);
17
  * Register a new POST route with the router.
18
  *
19
  * @param string $uri
20
+ * @param array|string|callable $action
21
  * @return \Illuminate\Routing\Route
22
  */
23
  public function post($uri, $action);
26
  * Register a new PUT route with the router.
27
  *
28
  * @param string $uri
29
+ * @param array|string|callable $action
30
  * @return \Illuminate\Routing\Route
31
  */
32
  public function put($uri, $action);
35
  * Register a new DELETE route with the router.
36
  *
37
  * @param string $uri
38
+ * @param array|string|callable $action
39
  * @return \Illuminate\Routing\Route
40
  */
41
  public function delete($uri, $action);
44
  * Register a new PATCH route with the router.
45
  *
46
  * @param string $uri
47
+ * @param array|string|callable $action
48
  * @return \Illuminate\Routing\Route
49
  */
50
  public function patch($uri, $action);
53
  * Register a new OPTIONS route with the router.
54
  *
55
  * @param string $uri
56
+ * @param array|string|callable $action
57
  * @return \Illuminate\Routing\Route
58
  */
59
  public function options($uri, $action);
63
  *
64
  * @param array|string $methods
65
  * @param string $uri
66
+ * @param array|string|callable $action
67
  * @return \Illuminate\Routing\Route
68
  */
69
  public function match($methods, $uri, $action);
73
  *
74
  * @param string $name
75
  * @param string $controller
76
+ * @param array $options
77
+ * @return \Illuminate\Routing\PendingResourceRegistration
78
  */
79
  public function resource($name, $controller, array $options = []);
80
 
vendor/illuminate/contracts/Routing/ResponseFactory.php CHANGED
@@ -5,7 +5,7 @@ namespace Illuminate\Contracts\Routing;
5
  interface ResponseFactory
6
  {
7
  /**
8
- * Return a new response from the application.
9
  *
10
  * @param string $content
11
  * @param int $status
@@ -15,9 +15,18 @@ interface ResponseFactory
15
  public function make($content = '', $status = 200, array $headers = []);
16
 
17
  /**
18
- * Return a new view response from the application.
19
  *
20
- * @param string $view
 
 
 
 
 
 
 
 
 
21
  * @param array $data
22
  * @param int $status
23
  * @param array $headers
@@ -26,9 +35,9 @@ interface ResponseFactory
26
  public function view($view, $data = [], $status = 200, array $headers = []);
27
 
28
  /**
29
- * Return a new JSON response from the application.
30
  *
31
- * @param string|array $data
32
  * @param int $status
33
  * @param array $headers
34
  * @param int $options
@@ -37,10 +46,10 @@ interface ResponseFactory
37
  public function json($data = [], $status = 200, array $headers = [], $options = 0);
38
 
39
  /**
40
- * Return a new JSONP response from the application.
41
  *
42
  * @param string $callback
43
- * @param string|array $data
44
  * @param int $status
45
  * @param array $headers
46
  * @param int $options
@@ -49,7 +58,7 @@ interface ResponseFactory
49
  public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0);
50
 
51
  /**
52
- * Return a new streamed response from the application.
53
  *
54
  * @param \Closure $callback
55
  * @param int $status
@@ -58,17 +67,37 @@ interface ResponseFactory
58
  */
59
  public function stream($callback, $status = 200, array $headers = []);
60
 
 
 
 
 
 
 
 
 
 
 
 
61
  /**
62
  * Create a new file download response.
63
  *
64
  * @param \SplFileInfo|string $file
65
- * @param string $name
66
  * @param array $headers
67
  * @param string|null $disposition
68
  * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
69
  */
70
  public function download($file, $name = null, array $headers = [], $disposition = 'attachment');
71
 
 
 
 
 
 
 
 
 
 
72
  /**
73
  * Create a new redirect response to the given path.
74
  *
@@ -84,7 +113,7 @@ interface ResponseFactory
84
  * Create a new redirect response to a named route.
85
  *
86
  * @param string $route
87
- * @param array $parameters
88
  * @param int $status
89
  * @param array $headers
90
  * @return \Illuminate\Http\RedirectResponse
@@ -95,7 +124,7 @@ interface ResponseFactory
95
  * Create a new redirect response to a controller action.
96
  *
97
  * @param string $action
98
- * @param array $parameters
99
  * @param int $status
100
  * @param array $headers
101
  * @return \Illuminate\Http\RedirectResponse
5
  interface ResponseFactory
6
  {
7
  /**
8
+ * Create a new response instance.
9
  *
10
  * @param string $content
11
  * @param int $status
15
  public function make($content = '', $status = 200, array $headers = []);
16
 
17
  /**
18
+ * Create a new "no content" response.
19
  *
20
+ * @param int $status
21
+ * @param array $headers
22
+ * @return \Illuminate\Http\Response
23
+ */
24
+ public function noContent($status = 204, array $headers = []);
25
+
26
+ /**
27
+ * Create a new response for a given view.
28
+ *
29
+ * @param string|array $view
30
  * @param array $data
31
  * @param int $status
32
  * @param array $headers
35
  public function view($view, $data = [], $status = 200, array $headers = []);
36
 
37
  /**
38
+ * Create a new JSON response instance.
39
  *
40
+ * @param mixed $data
41
  * @param int $status
42
  * @param array $headers
43
  * @param int $options
46
  public function json($data = [], $status = 200, array $headers = [], $options = 0);
47
 
48
  /**
49
+ * Create a new JSONP response instance.
50
  *
51
  * @param string $callback
52
+ * @param mixed $data
53
  * @param int $status
54
  * @param array $headers
55
  * @param int $options
58
  public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0);
59
 
60
  /**
61
+ * Create a new streamed response instance.
62
  *
63
  * @param \Closure $callback
64
  * @param int $status
67
  */
68
  public function stream($callback, $status = 200, array $headers = []);
69
 
70
+ /**
71
+ * Create a new streamed response instance as a file download.
72
+ *
73
+ * @param \Closure $callback
74
+ * @param string|null $name
75
+ * @param array $headers
76
+ * @param string|null $disposition
77
+ * @return \Symfony\Component\HttpFoundation\StreamedResponse
78
+ */
79
+ public function streamDownload($callback, $name = null, array $headers = [], $disposition = 'attachment');
80
+
81
  /**
82
  * Create a new file download response.
83
  *
84
  * @param \SplFileInfo|string $file
85
+ * @param string|null $name
86
  * @param array $headers
87
  * @param string|null $disposition
88
  * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
89
  */
90
  public function download($file, $name = null, array $headers = [], $disposition = 'attachment');
91
 
92
+ /**
93
+ * Return the raw contents of a binary file.
94
+ *
95
+ * @param \SplFileInfo|string $file
96
+ * @param array $headers
97
+ * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
98
+ */
99
+ public function file($file, array $headers = []);
100
+
101
  /**
102
  * Create a new redirect response to the given path.
103
  *
113
  * Create a new redirect response to a named route.
114
  *
115
  * @param string $route
116
+ * @param mixed $parameters
117
  * @param int $status
118
  * @param array $headers
119
  * @return \Illuminate\Http\RedirectResponse
124
  * Create a new redirect response to a controller action.
125
  *
126
  * @param string $action
127
+ * @param mixed $parameters
128
  * @param int $status
129
  * @param array $headers
130
  * @return \Illuminate\Http\RedirectResponse
vendor/illuminate/contracts/Routing/UrlGenerator.php CHANGED
@@ -11,12 +11,20 @@ interface UrlGenerator
11
  */
12
  public function current();
13
 
 
 
 
 
 
 
 
 
14
  /**
15
  * Generate an absolute URL to the given path.
16
  *
17
  * @param string $path
18
  * @param mixed $extra
19
- * @param bool $secure
20
  * @return string
21
  */
22
  public function to($path, $extra = [], $secure = null);
@@ -25,7 +33,7 @@ interface UrlGenerator
25
  * Generate a secure, absolute URL to the given path.
26
  *
27
  * @param string $path
28
- * @param array $parameters
29
  * @return string
30
  */
31
  public function secure($path, $parameters = []);
@@ -34,7 +42,7 @@ interface UrlGenerator
34
  * Generate the URL to an application asset.
35
  *
36
  * @param string $path
37
- * @param bool $secure
38
  * @return string
39
  */
40
  public function asset($path, $secure = null);
@@ -43,7 +51,7 @@ interface UrlGenerator
43
  * Get the URL to a named route.
44
  *
45
  * @param string $name
46
- * @param mixed $parameters
47
  * @param bool $absolute
48
  * @return string
49
  *
@@ -54,9 +62,9 @@ interface UrlGenerator
54
  /**
55
  * Get the URL to a controller action.
56
  *
57
- * @param string $action
58
- * @param mixed $parameters
59
- * @param bool $absolute
60
  * @return string
61
  */
62
  public function action($action, $parameters = [], $absolute = true);
11
  */
12
  public function current();
13
 
14
+ /**
15
+ * Get the URL for the previous request.
16
+ *
17
+ * @param mixed $fallback
18
+ * @return string
19
+ */
20
+ public function previous($fallback = false);
21
+
22
  /**
23
  * Generate an absolute URL to the given path.
24
  *
25
  * @param string $path
26
  * @param mixed $extra
27
+ * @param bool|null $secure
28
  * @return string
29
  */
30
  public function to($path, $extra = [], $secure = null);
33
  * Generate a secure, absolute URL to the given path.
34
  *
35
  * @param string $path
36
+ * @param array $parameters
37
  * @return string
38
  */
39
  public function secure($path, $parameters = []);
42
  * Generate the URL to an application asset.
43
  *
44
  * @param string $path
45
+ * @param bool|null $secure
46
  * @return string
47
  */
48
  public function asset($path, $secure = null);
51
  * Get the URL to a named route.
52
  *
53
  * @param string $name
54
+ * @param mixed $parameters
55
  * @param bool $absolute
56
  * @return string
57
  *
62
  /**
63
  * Get the URL to a controller action.
64
  *
65
+ * @param string|array $action
66
+ * @param mixed $parameters
67
+ * @param bool $absolute
68
  * @return string
69
  */
70
  public function action($action, $parameters = [], $absolute = true);
vendor/illuminate/contracts/Routing/UrlRoutable.php CHANGED
@@ -17,4 +17,23 @@ interface UrlRoutable
17
  * @return string
18
  */
19
  public function getRouteKeyName();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
17
  * @return string
18
  */
19
  public function getRouteKeyName();
20
+
21
+ /**
22
+ * Retrieve the model for a bound value.
23
+ *
24
+ * @param mixed $value
25
+ * @param string|null $field
26
+ * @return \Illuminate\Database\Eloquent\Model|null
27
+ */
28
+ public function resolveRouteBinding($value, $field = null);
29
+
30
+ /**
31
+ * Retrieve the child model for a bound value.
32
+ *
33
+ * @param string $childType
34
+ * @param mixed $value
35
+ * @param string|null $field
36
+ * @return \Illuminate\Database\Eloquent\Model|null
37
+ */
38
+ public function resolveChildRouteBinding($childType, $value, $field);
39
  }
vendor/illuminate/contracts/Session/Session.php CHANGED
@@ -11,6 +11,14 @@ interface Session
11
  */
12
  public function getName();
13
 
 
 
 
 
 
 
 
 
14
  /**
15
  * Get the current session ID.
16
  *
@@ -36,7 +44,7 @@ interface Session
36
  /**
37
  * Save the session data to storage.
38
  *
39
- * @return bool
40
  */
41
  public function save();
42
 
@@ -56,7 +64,7 @@ interface Session
56
  public function exists($key);
57
 
58
  /**
59
- * Checks if an a key is present and not null.
60
  *
61
  * @param string|array $key
62
  * @return bool
@@ -72,11 +80,20 @@ interface Session
72
  */
73
  public function get($key, $default = null);
74
 
 
 
 
 
 
 
 
 
 
75
  /**
76
  * Put a key / value pair or array of key / value pairs in the session.
77
  *
78
  * @param string|array $key
79
- * @param mixed $value
80
  * @return void
81
  */
82
  public function put($key, $value = null);
@@ -88,6 +105,13 @@ interface Session
88
  */
89
  public function token();
90
 
 
 
 
 
 
 
 
91
  /**
92
  * Remove an item from the session, returning its value.
93
  *
@@ -111,6 +135,21 @@ interface Session
111
  */
112
  public function flush();
113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  /**
115
  * Generate a new session ID for the session.
116
  *
11
  */
12
  public function getName();
13
 
14
+ /**
15
+ * Set the name of the session.
16
+ *
17
+ * @param string $name
18
+ * @return void
19
+ */
20
+ public function setName($name);
21
+
22
  /**
23
  * Get the current session ID.
24
  *
44
  /**
45
  * Save the session data to storage.
46
  *
47
+ * @return void
48
  */
49
  public function save();
50
 
64
  public function exists($key);
65
 
66
  /**
67
+ * Checks if a key is present and not null.
68
  *
69
  * @param string|array $key
70
  * @return bool
80
  */
81
  public function get($key, $default = null);
82
 
83
+ /**
84
+ * Get the value of a given key and then forget it.
85
+ *
86
+ * @param string $key
87
+ * @param mixed $default
88
+ * @return mixed
89
+ */
90
+ public function pull($key, $default = null);
91
+
92
  /**
93
  * Put a key / value pair or array of key / value pairs in the session.
94
  *
95
  * @param string|array $key
96
+ * @param mixed $value
97
  * @return void
98
  */
99
  public function put($key, $value = null);
105
  */
106
  public function token();
107
 
108
+ /**
109
+ * Regenerate the CSRF token value.
110
+ *
111
+ * @return void
112
+ */
113
+ public function regenerateToken();
114
+
115
  /**
116
  * Remove an item from the session, returning its value.
117
  *
135
  */
136
  public function flush();
137
 
138
+ /**
139
+ * Flush the session data and regenerate the ID.
140
+ *
141
+ * @return bool
142
+ */
143
+ public function invalidate();
144
+
145
+ /**
146
+ * Generate a new session identifier.
147
+ *
148
+ * @param bool $destroy
149
+ * @return bool
150
+ */
151
+ public function regenerate($destroy = false);
152
+
153
  /**
154
  * Generate a new session ID for the session.
155
  *
vendor/illuminate/contracts/Support/DeferrableProvider.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Support;
4
+
5
+ interface DeferrableProvider
6
+ {
7
+ /**
8
+ * Get the services provided by the provider.
9
+ *
10
+ * @return array
11
+ */
12
+ public function provides();
13
+ }
vendor/illuminate/contracts/Support/DeferringDisplayableValue.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Support;
4
+
5
+ interface DeferringDisplayableValue
6
+ {
7
+ /**
8
+ * Resolve the displayable value that the class is deferring.
9
+ *
10
+ * @return \Illuminate\Contracts\Support\Htmlable|string
11
+ */
12
+ public function resolveDisplayableValue();
13
+ }
vendor/illuminate/contracts/Support/MessageBag.php CHANGED
@@ -39,8 +39,8 @@ interface MessageBag extends Arrayable
39
  /**
40
  * Get the first message from the bag for a given key.
41
  *
42
- * @param string $key
43
- * @param string $format
44
  * @return string
45
  */
46
  public function first($key = null, $format = null);
@@ -49,7 +49,7 @@ interface MessageBag extends Arrayable
49
  * Get all of the messages from the bag for a given key.
50
  *
51
  * @param string $key
52
- * @param string $format
53
  * @return array
54
  */
55
  public function get($key, $format = null);
@@ -57,11 +57,18 @@ interface MessageBag extends Arrayable
57
  /**
58
  * Get all of the messages for every key in the bag.
59
  *
60
- * @param string $format
61
  * @return array
62
  */
63
  public function all($format = null);
64
 
 
 
 
 
 
 
 
65
  /**
66
  * Get the default message format.
67
  *
@@ -84,6 +91,13 @@ interface MessageBag extends Arrayable
84
  */
85
  public function isEmpty();
86
 
 
 
 
 
 
 
 
87
  /**
88
  * Get the number of messages in the container.
89
  *
39
  /**
40
  * Get the first message from the bag for a given key.
41
  *
42
+ * @param string|null $key
43
+ * @param string|null $format
44
  * @return string
45
  */
46
  public function first($key = null, $format = null);
49
  * Get all of the messages from the bag for a given key.
50
  *
51
  * @param string $key
52
+ * @param string|null $format
53
  * @return array
54
  */
55
  public function get($key, $format = null);
57
  /**
58
  * Get all of the messages for every key in the bag.
59
  *
60
+ * @param string|null $format
61
  * @return array
62
  */
63
  public function all($format = null);
64
 
65
+ /**
66
+ * Get the raw messages in the container.
67
+ *
68
+ * @return array
69
+ */
70
+ public function getMessages();
71
+
72
  /**
73
  * Get the default message format.
74
  *
91
  */
92
  public function isEmpty();
93
 
94
+ /**
95
+ * Determine if the message bag has any messages.
96
+ *
97
+ * @return bool
98
+ */
99
+ public function isNotEmpty();
100
+
101
  /**
102
  * Get the number of messages in the container.
103
  *
vendor/illuminate/contracts/Support/Responsable.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Support;
4
+
5
+ interface Responsable
6
+ {
7
+ /**
8
+ * Create an HTTP response that represents the object.
9
+ *
10
+ * @param \Illuminate\Http\Request $request
11
+ * @return \Symfony\Component\HttpFoundation\Response
12
+ */
13
+ public function toResponse($request);
14
+ }
vendor/illuminate/contracts/Translation/HasLocalePreference.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Translation;
4
+
5
+ interface HasLocalePreference
6
+ {
7
+ /**
8
+ * Get the preferred locale of the entity.
9
+ *
10
+ * @return string|null
11
+ */
12
+ public function preferredLocale();
13
+ }
vendor/illuminate/contracts/Translation/Loader.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Translation;
4
+
5
+ interface Loader
6
+ {
7
+ /**
8
+ * Load the messages for the given locale.
9
+ *
10
+ * @param string $locale
11
+ * @param string $group
12
+ * @param string|null $namespace
13
+ * @return array
14
+ */
15
+ public function load($locale, $group, $namespace = null);
16
+
17
+ /**
18
+ * Add a new namespace to the loader.
19
+ *
20
+ * @param string $namespace
21
+ * @param string $hint
22
+ * @return void
23
+ */
24
+ public function addNamespace($namespace, $hint);
25
+
26
+ /**
27
+ * Add a new JSON path to the loader.
28
+ *
29
+ * @param string $path
30
+ * @return void
31
+ */
32
+ public function addJsonPath($path);
33
+
34
+ /**
35
+ * Get an array of all the registered namespaces.
36
+ *
37
+ * @return array
38
+ */
39
+ public function namespaces();
40
+ }
vendor/illuminate/contracts/Translation/Translator.php CHANGED
@@ -8,22 +8,22 @@ interface Translator
8
  * Get the translation for a given key.
9
  *
10
  * @param string $key
11
- * @param array $replace
12
- * @param string $locale
13
  * @return mixed
14
  */
15
- public function trans($key, array $replace = [], $locale = null);
16
 
17
  /**
18
  * Get a translation according to an integer value.
19
  *
20
  * @param string $key
21
- * @param int|array|\Countable $number
22
- * @param array $replace
23
- * @param string $locale
24
  * @return string
25
  */
26
- public function transChoice($key, $number, array $replace = [], $locale = null);
27
 
28
  /**
29
  * Get the default locale being used.
8
  * Get the translation for a given key.
9
  *
10
  * @param string $key
11
+ * @param array $replace
12
+ * @param string|null $locale
13
  * @return mixed
14
  */
15
+ public function get($key, array $replace = [], $locale = null);
16
 
17
  /**
18
  * Get a translation according to an integer value.
19
  *
20
  * @param string $key
21
+ * @param \Countable|int|array $number
22
+ * @param array $replace
23
+ * @param string|null $locale
24
  * @return string
25
  */
26
+ public function choice($key, $number, array $replace = [], $locale = null);
27
 
28
  /**
29
  * Get the default locale being used.
vendor/illuminate/contracts/Validation/Factory.php CHANGED
@@ -20,7 +20,7 @@ interface Factory
20
  *
21
  * @param string $rule
22
  * @param \Closure|string $extension
23
- * @param string $message
24
  * @return void
25
  */
26
  public function extend($rule, $extension, $message = null);
@@ -28,9 +28,9 @@ interface Factory
28
  /**
29
  * Register a custom implicit validator extension.
30
  *
31
- * @param string $rule
32
  * @param \Closure|string $extension
33
- * @param string $message
34
  * @return void
35
  */
36
  public function extendImplicit($rule, $extension, $message = null);
@@ -38,7 +38,7 @@ interface Factory
38
  /**
39
  * Register a custom implicit validator message replacer.
40
  *
41
- * @param string $rule
42
  * @param \Closure|string $replacer
43
  * @return void
44
  */
20
  *
21
  * @param string $rule
22
  * @param \Closure|string $extension
23
+ * @param string|null $message
24
  * @return void
25
  */
26
  public function extend($rule, $extension, $message = null);
28
  /**
29
  * Register a custom implicit validator extension.
30
  *
31
+ * @param string $rule
32
  * @param \Closure|string $extension
33
+ * @param string|null $message
34
  * @return void
35
  */
36
  public function extendImplicit($rule, $extension, $message = null);
38
  /**
39
  * Register a custom implicit validator message replacer.
40
  *
41
+ * @param string $rule
42
  * @param \Closure|string $replacer
43
  * @return void
44
  */
vendor/illuminate/contracts/Validation/ImplicitRule.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Validation;
4
+
5
+ interface ImplicitRule extends Rule
6
+ {
7
+ //
8
+ }
vendor/illuminate/contracts/Validation/Rule.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\Validation;
4
+
5
+ interface Rule
6
+ {
7
+ /**
8
+ * Determine if the validation rule passes.
9
+ *
10
+ * @param string $attribute
11
+ * @param mixed $value
12
+ * @return bool
13
+ */
14
+ public function passes($attribute, $value);
15
+
16
+ /**
17
+ * Get the validation error message.
18
+ *
19
+ * @return string|array
20
+ */
21
+ public function message();
22
+ }
vendor/illuminate/contracts/Validation/ValidatesWhenResolved.php CHANGED
@@ -9,5 +9,5 @@ interface ValidatesWhenResolved
9
  *
10
  * @return void
11
  */
12
- public function validate();
13
  }
9
  *
10
  * @return void
11
  */
12
+ public function validateResolved();
13
  }
vendor/illuminate/contracts/Validation/Validator.php CHANGED
@@ -6,6 +6,24 @@ use Illuminate\Contracts\Support\MessageProvider;
6
 
7
  interface Validator extends MessageProvider
8
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  /**
10
  * Determine if the data fails the validation rules.
11
  *
@@ -23,7 +41,7 @@ interface Validator extends MessageProvider
23
  /**
24
  * Add conditions to a given field based on a Closure.
25
  *
26
- * @param string $attribute
27
  * @param string|array $rules
28
  * @param callable $callback
29
  * @return $this
@@ -31,10 +49,17 @@ interface Validator extends MessageProvider
31
  public function sometimes($attribute, $rules, callable $callback);
32
 
33
  /**
34
- * After an after validation callback.
35
  *
36
  * @param callable|string $callback
37
  * @return $this
38
  */
39
  public function after($callback);
 
 
 
 
 
 
 
40
  }
6
 
7
  interface Validator extends MessageProvider
8
  {
9
+ /**
10
+ * Run the validator's rules against its data.
11
+ *
12
+ * @return array
13
+ *
14
+ * @throws \Illuminate\Validation\ValidationException
15
+ */
16
+ public function validate();
17
+
18
+ /**
19
+ * Get the attributes and values that were validated.
20
+ *
21
+ * @return array
22
+ *
23
+ * @throws \Illuminate\Validation\ValidationException
24
+ */
25
+ public function validated();
26
+
27
  /**
28
  * Determine if the data fails the validation rules.
29
  *
41
  /**
42
  * Add conditions to a given field based on a Closure.
43
  *
44
+ * @param string|array $attribute
45
  * @param string|array $rules
46
  * @param callable $callback
47
  * @return $this
49
  public function sometimes($attribute, $rules, callable $callback);
50
 
51
  /**
52
+ * Add an after validation callback.
53
  *
54
  * @param callable|string $callback
55
  * @return $this
56
  */
57
  public function after($callback);
58
+
59
+ /**
60
+ * Get all of the validation error messages.
61
+ *
62
+ * @return \Illuminate\Support\MessageBag
63
+ */
64
+ public function errors();
65
  }
vendor/illuminate/contracts/View/Engine.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Contracts\View;
4
+
5
+ interface Engine
6
+ {
7
+ /**
8
+ * Get the evaluated contents of the view.
9
+ *
10
+ * @param string $path
11
+ * @param array $data
12
+ * @return string
13
+ */
14
+ public function get($path, array $data = []);
15
+ }
vendor/illuminate/contracts/View/Factory.php CHANGED
@@ -16,7 +16,7 @@ interface Factory
16
  * Get the evaluated view contents for the given path.
17
  *
18
  * @param string $path
19
- * @param array $data
20
  * @param array $mergeData
21
  * @return \Illuminate\Contracts\View\View
22
  */
@@ -26,7 +26,7 @@ interface Factory
26
  * Get the evaluated view contents for the given view.
27
  *
28
  * @param string $view
29
- * @param array $data
30
  * @param array $mergeData
31
  * @return \Illuminate\Contracts\View\View
32
  */
16
  * Get the evaluated view contents for the given path.
17
  *
18
  * @param string $path
19
+ * @param \Illuminate\Contracts\Support\Arrayable|array $data
20
  * @param array $mergeData
21
  * @return \Illuminate\Contracts\View\View
22
  */
26
  * Get the evaluated view contents for the given view.
27
  *
28
  * @param string $view
29
+ * @param \Illuminate\Contracts\Support\Arrayable|array $data
30
  * @param array $mergeData
31
  * @return \Illuminate\Contracts\View\View
32
  */
vendor/illuminate/contracts/View/View.php CHANGED
@@ -17,8 +17,15 @@ interface View extends Renderable
17
  * Add a piece of data to the view.
18
  *
19
  * @param string|array $key
20
- * @param mixed $value
21
  * @return $this
22
  */
23
  public function with($key, $value = null);
 
 
 
 
 
 
 
24
  }
17
  * Add a piece of data to the view.
18
  *
19
  * @param string|array $key
20
+ * @param mixed $value
21
  * @return $this
22
  */
23
  public function with($key, $value = null);
24
+
25
+ /**
26
+ * Get the array of view data.
27
+ *
28
+ * @return array
29
+ */
30
+ public function getData();
31
  }
vendor/illuminate/contracts/composer.json CHANGED
@@ -14,7 +14,9 @@
14
  }
15
  ],
16
  "require": {
17
- "php": ">=5.6.4"
 
 
18
  },
19
  "autoload": {
20
  "psr-4": {
@@ -23,7 +25,7 @@
23
  },
24
  "extra": {
25
  "branch-alias": {
26
- "dev-master": "5.4-dev"
27
  }
28
  },
29
  "config": {
14
  }
15
  ],
16
  "require": {
17
+ "php": "^7.3|^8.0",
18
+ "psr/container": "^1.0",
19
+ "psr/simple-cache": "^1.0"
20
  },
21
  "autoload": {
22
  "psr-4": {
25
  },
26
  "extra": {
27
  "branch-alias": {
28
+ "dev-master": "8.x-dev"
29
  }
30
  },
31
  "config": {
vendor/illuminate/filesystem/Cache.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Filesystem;
4
+
5
+ use Illuminate\Contracts\Cache\Repository;
6
+ use League\Flysystem\Cached\Storage\AbstractCache;
7
+
8
+ class Cache extends AbstractCache
9
+ {
10
+ /**
11
+ * The cache repository implementation.
12
+ *
13
+ * @var \Illuminate\Contracts\Cache\Repository
14
+ */
15
+ protected $repository;
16
+
17
+ /**
18
+ * The cache key.
19
+ *
20
+ * @var string
21
+ */
22
+ protected $key;
23
+
24
+ /**
25
+ * The cache expiration time in seconds.
26
+ *
27
+ * @var int|null
28
+ */
29
+ protected $expire;
30
+
31
+ /**
32
+ * Create a new cache instance.
33
+ *
34
+ * @param \Illuminate\Contracts\Cache\Repository $repository
35
+ * @param string $key
36
+ * @param int|null $expire
37
+ * @return void
38
+ */
39
+ public function __construct(Repository $repository, $key = 'flysystem', $expire = null)
40
+ {
41
+ $this->key = $key;
42
+ $this->expire = $expire;
43
+ $this->repository = $repository;
44
+ }
45
+
46
+ /**
47
+ * Load the cache.
48
+ *
49
+ * @return void
50
+ */
51
+ public function load()
52
+ {
53
+ $contents = $this->repository->get($this->key);
54
+
55
+ if (! is_null($contents)) {
56
+ $this->setFromStorage($contents);
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Persist the cache.
62
+ *
63
+ * @return void
64
+ */
65
+ public function save()
66
+ {
67
+ $contents = $this->getForStorage();
68
+
69
+ $this->repository->put($this->key, $contents, $this->expire);
70
+ }
71
+ }
vendor/illuminate/filesystem/Filesystem.php CHANGED
@@ -4,9 +4,14 @@ namespace Illuminate\Filesystem;
4
 
5
  use ErrorException;
6
  use FilesystemIterator;
7
- use Symfony\Component\Finder\Finder;
8
- use Illuminate\Support\Traits\Macroable;
9
  use Illuminate\Contracts\Filesystem\FileNotFoundException;
 
 
 
 
 
 
 
10
 
11
  class Filesystem
12
  {
@@ -23,6 +28,17 @@ class Filesystem
23
  return file_exists($path);
24
  }
25
 
 
 
 
 
 
 
 
 
 
 
 
26
  /**
27
  * Get the contents of a file.
28
  *
@@ -38,7 +54,7 @@ class Filesystem
38
  return $lock ? $this->sharedGet($path) : file_get_contents($path);
39
  }
40
 
41
- throw new FileNotFoundException("File does not exist at path {$path}");
42
  }
43
 
44
  /**
@@ -74,28 +90,75 @@ class Filesystem
74
  * Get the returned value of a file.
75
  *
76
  * @param string $path
 
77
  * @return mixed
78
  *
79
  * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
80
  */
81
- public function getRequire($path)
82
  {
83
  if ($this->isFile($path)) {
84
- return require $path;
 
 
 
 
 
 
 
85
  }
86
 
87
- throw new FileNotFoundException("File does not exist at path {$path}");
88
  }
89
 
90
  /**
91
  * Require the given file once.
92
  *
93
- * @param string $file
 
94
  * @return mixed
95
  */
96
- public function requireOnce($file)
97
  {
98
- require_once $file;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
 
101
  /**
@@ -115,13 +178,37 @@ class Filesystem
115
  * @param string $path
116
  * @param string $contents
117
  * @param bool $lock
118
- * @return int
119
  */
120
  public function put($path, $contents, $lock = false)
121
  {
122
  return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  /**
126
  * Prepend to a file.
127
  *
@@ -154,7 +241,7 @@ class Filesystem
154
  * Get or set UNIX mode of a file or directory.
155
  *
156
  * @param string $path
157
- * @param int $mode
158
  * @return mixed
159
  */
160
  public function chmod($path, $mode = null)
@@ -216,7 +303,7 @@ class Filesystem
216
  }
217
 
218
  /**
219
- * Create a hard link to the target file or directory.
220
  *
221
  * @param string $target
222
  * @param string $link
@@ -230,7 +317,27 @@ class Filesystem
230
 
231
  $mode = $this->isDirectory($target) ? 'J' : 'H';
232
 
233
- exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  }
235
 
236
  /**
@@ -277,6 +384,23 @@ class Filesystem
277
  return pathinfo($path, PATHINFO_EXTENSION);
278
  }
279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  /**
281
  * Get the file type of a given file.
282
  *
@@ -369,7 +493,7 @@ class Filesystem
369
  * Find path names matching a given pattern.
370
  *
371
  * @param string $pattern
372
- * @param int $flags
373
  * @return array
374
  */
375
  public function glob($pattern, $flags = 0)
@@ -381,22 +505,15 @@ class Filesystem
381
  * Get an array of all files in a directory.
382
  *
383
  * @param string $directory
384
- * @return array
 
385
  */
386
- public function files($directory)
387
  {
388
- $glob = glob($directory.DIRECTORY_SEPARATOR.'*');
389
-
390
- if ($glob === false) {
391
- return [];
392
- }
393
-
394
- // To get the appropriate files, we'll simply glob the directory and filter
395
- // out any "files" that are not truly files so we do not end up with any
396
- // directories in our list, but only true files within the directory.
397
- return array_filter($glob, function ($file) {
398
- return filetype($file) == 'file';
399
- });
400
  }
401
 
402
  /**
@@ -404,11 +521,14 @@ class Filesystem
404
  *
405
  * @param string $directory
406
  * @param bool $hidden
407
- * @return array
408
  */
409
  public function allFiles($directory, $hidden = false)
410
  {
411
- return iterator_to_array(Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory), false);
 
 
 
412
  }
413
 
414
  /**
@@ -421,20 +541,35 @@ class Filesystem
421
  {
422
  $directories = [];
423
 
424
- foreach (Finder::create()->in($directory)->directories()->depth(0) as $dir) {
425
  $directories[] = $dir->getPathname();
426
  }
427
 
428
  return $directories;
429
  }
430
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
  /**
432
  * Create a directory.
433
  *
434
  * @param string $path
435
- * @param int $mode
436
- * @param bool $recursive
437
- * @param bool $force
438
  * @return bool
439
  */
440
  public function makeDirectory($path, $mode = 0755, $recursive = false, $force = false)
@@ -456,10 +591,8 @@ class Filesystem
456
  */
457
  public function moveDirectory($from, $to, $overwrite = false)
458
  {
459
- if ($overwrite && $this->isDirectory($to)) {
460
- if (! $this->deleteDirectory($to)) {
461
- return false;
462
- }
463
  }
464
 
465
  return @rename($from, $to) === true;
@@ -470,7 +603,7 @@ class Filesystem
470
  *
471
  * @param string $directory
472
  * @param string $destination
473
- * @param int $options
474
  * @return bool
475
  */
476
  public function copyDirectory($directory, $destination, $options = null)
@@ -484,9 +617,7 @@ class Filesystem
484
  // If the destination directory does not actually exist, we will go ahead and
485
  // create it recursively, which just gets the destination prepared to copy
486
  // the files over. Once we make the directory we'll proceed the copying.
487
- if (! $this->isDirectory($destination)) {
488
- $this->makeDirectory($destination, 0777, true);
489
- }
490
 
491
  $items = new FilesystemIterator($directory, $options);
492
 
@@ -523,7 +654,7 @@ class Filesystem
523
  * The directory itself may be optionally preserved.
524
  *
525
  * @param string $directory
526
- * @param bool $preserve
527
  * @return bool
528
  */
529
  public function deleteDirectory($directory, $preserve = false)
@@ -557,6 +688,27 @@ class Filesystem
557
  return true;
558
  }
559
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  /**
561
  * Empty the specified directory of all files and folders.
562
  *
4
 
5
  use ErrorException;
6
  use FilesystemIterator;
 
 
7
  use Illuminate\Contracts\Filesystem\FileNotFoundException;
8
+ use Illuminate\Support\LazyCollection;
9
+ use Illuminate\Support\Traits\Macroable;
10
+ use RuntimeException;
11
+ use SplFileObject;
12
+ use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;
13
+ use Symfony\Component\Finder\Finder;
14
+ use Symfony\Component\Mime\MimeTypes;
15
 
16
  class Filesystem
17
  {
28
  return file_exists($path);
29
  }
30
 
31
+ /**
32
+ * Determine if a file or directory is missing.
33
+ *
34
+ * @param string $path
35
+ * @return bool
36
+ */
37
+ public function missing($path)
38
+ {
39
+ return ! $this->exists($path);
40
+ }
41
+
42
  /**
43
  * Get the contents of a file.
44
  *
54
  return $lock ? $this->sharedGet($path) : file_get_contents($path);
55
  }
56
 
57
+ throw new FileNotFoundException("File does not exist at path {$path}.");
58
  }
59
 
60
  /**
90
  * Get the returned value of a file.
91
  *
92
  * @param string $path
93
+ * @param array $data
94
  * @return mixed
95
  *
96
  * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
97
  */
98
+ public function getRequire($path, array $data = [])
99
  {
100
  if ($this->isFile($path)) {
101
+ $__path = $path;
102
+ $__data = $data;
103
+
104
+ return (static function () use ($__path, $__data) {
105
+ extract($__data, EXTR_SKIP);
106
+
107
+ return require $__path;
108
+ })();
109
  }
110
 
111
+ throw new FileNotFoundException("File does not exist at path {$path}.");
112
  }
113
 
114
  /**
115
  * Require the given file once.
116
  *
117
+ * @param string $path
118
+ * @param array $data
119
  * @return mixed
120
  */
121
+ public function requireOnce($path, array $data = [])
122
  {
123
+ if ($this->isFile($path)) {
124
+ $__path = $path;
125
+ $__data = $data;
126
+
127
+ return (static function () use ($__path, $__data) {
128
+ extract($__data, EXTR_SKIP);
129
+
130
+ return require_once $__path;
131
+ })();
132
+ }
133
+
134
+ throw new FileNotFoundException("File does not exist at path {$path}.");
135
+ }
136
+
137
+ /**
138
+ * Get the contents of a file one line at a time.
139
+ *
140
+ * @param string $path
141
+ * @return \Illuminate\Support\LazyCollection
142
+ *
143
+ * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
144
+ */
145
+ public function lines($path)
146
+ {
147
+ if (! $this->isFile($path)) {
148
+ throw new FileNotFoundException(
149
+ "File does not exist at path {$path}."
150
+ );
151
+ }
152
+
153
+ return LazyCollection::make(function () use ($path) {
154
+ $file = new SplFileObject($path);
155
+
156
+ $file->setFlags(SplFileObject::DROP_NEW_LINE);
157
+
158
+ while (! $file->eof()) {
159
+ yield $file->fgets();
160
+ }
161
+ });
162
  }
163
 
164
  /**
178
  * @param string $path
179
  * @param string $contents
180
  * @param bool $lock
181
+ * @return int|bool
182
  */
183
  public function put($path, $contents, $lock = false)
184
  {
185
  return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);
186
  }
187
 
188
+ /**
189
+ * Write the contents of a file, replacing it atomically if it already exists.
190
+ *
191
+ * @param string $path
192
+ * @param string $content
193
+ * @return void
194
+ */
195
+ public function replace($path, $content)
196
+ {
197
+ // If the path already exists and is a symlink, get the real path...
198
+ clearstatcache(true, $path);
199
+
200
+ $path = realpath($path) ?: $path;
201
+
202
+ $tempPath = tempnam(dirname($path), basename($path));
203
+
204
+ // Fix permissions of tempPath because `tempnam()` creates it with permissions set to 0600...
205
+ chmod($tempPath, 0777 - umask());
206
+
207
+ file_put_contents($tempPath, $content);
208
+
209
+ rename($tempPath, $path);
210
+ }
211
+
212
  /**
213
  * Prepend to a file.
214
  *
241
  * Get or set UNIX mode of a file or directory.
242
  *
243
  * @param string $path
244
+ * @param int|null $mode
245
  * @return mixed
246
  */
247
  public function chmod($path, $mode = null)
303
  }
304
 
305
  /**
306
+ * Create a symlink to the target file or directory. On Windows, a hard link is created if the target is a file.
307
  *
308
  * @param string $target
309
  * @param string $link
317
 
318
  $mode = $this->isDirectory($target) ? 'J' : 'H';
319
 
320
+ exec("mklink /{$mode} ".escapeshellarg($link).' '.escapeshellarg($target));
321
+ }
322
+
323
+ /**
324
+ * Create a relative symlink to the target file or directory.
325
+ *
326
+ * @param string $target
327
+ * @param string $link
328
+ * @return void
329
+ */
330
+ public function relativeLink($target, $link)
331
+ {
332
+ if (! class_exists(SymfonyFilesystem::class)) {
333
+ throw new RuntimeException(
334
+ 'To enable support for relative links, please install the symfony/filesystem package.'
335
+ );
336
+ }
337
+
338
+ $relativeTarget = (new SymfonyFilesystem)->makePathRelative($target, dirname($link));
339
+
340
+ $this->link($relativeTarget, $link);
341
  }
342
 
343
  /**
384
  return pathinfo($path, PATHINFO_EXTENSION);
385
  }
386
 
387
+ /**
388
+ * Guess the file extension from the mime-type of a given file.
389
+ *
390
+ * @param string $path
391
+ * @return string|null
392
+ */
393
+ public function guessExtension($path)
394
+ {
395
+ if (! class_exists(MimeTypes::class)) {
396
+ throw new RuntimeException(
397
+ 'To enable support for guessing extensions, please install the symfony/mime package.'
398
+ );
399
+ }
400
+
401
+ return (new MimeTypes)->getExtensions($this->mimeType($path))[0] ?? null;
402
+ }
403
+
404
  /**
405
  * Get the file type of a given file.
406
  *
493
  * Find path names matching a given pattern.
494
  *
495
  * @param string $pattern
496
+ * @param int $flags
497
  * @return array
498
  */
499
  public function glob($pattern, $flags = 0)
505
  * Get an array of all files in a directory.
506
  *
507
  * @param string $directory
508
+ * @param bool $hidden
509
+ * @return \Symfony\Component\Finder\SplFileInfo[]
510
  */
511
+ public function files($directory, $hidden = false)
512
  {
513
+ return iterator_to_array(
514
+ Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory)->depth(0)->sortByName(),
515
+ false
516
+ );
 
 
 
 
 
 
 
 
517
  }
518
 
519
  /**
521
  *
522
  * @param string $directory
523
  * @param bool $hidden
524
+ * @return \Symfony\Component\Finder\SplFileInfo[]
525
  */
526
  public function allFiles($directory, $hidden = false)
527
  {
528
+ return iterator_to_array(
529
+ Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory)->sortByName(),
530
+ false
531
+ );
532
  }
533
 
534
  /**
541
  {
542
  $directories = [];
543
 
544
+ foreach (Finder::create()->in($directory)->directories()->depth(0)->sortByName() as $dir) {
545
  $directories[] = $dir->getPathname();
546
  }
547
 
548
  return $directories;
549
  }
550
 
551
+ /**
552
+ * Ensure a directory exists.
553
+ *
554
+ * @param string $path
555
+ * @param int $mode
556
+ * @param bool $recursive
557
+ * @return void
558
+ */
559
+ public function ensureDirectoryExists($path, $mode = 0755, $recursive = true)
560
+ {
561
+ if (! $this->isDirectory($path)) {
562
+ $this->makeDirectory($path, $mode, $recursive);
563
+ }
564
+ }
565
+
566
  /**
567
  * Create a directory.
568
  *
569
  * @param string $path
570
+ * @param int $mode
571
+ * @param bool $recursive
572
+ * @param bool $force
573
  * @return bool
574
  */
575
  public function makeDirectory($path, $mode = 0755, $recursive = false, $force = false)
591
  */
592
  public function moveDirectory($from, $to, $overwrite = false)
593
  {
594
+ if ($overwrite && $this->isDirectory($to) && ! $this->deleteDirectory($to)) {
595
+ return false;
 
 
596
  }
597
 
598
  return @rename($from, $to) === true;
603
  *
604
  * @param string $directory
605
  * @param string $destination
606
+ * @param int|null $options
607
  * @return bool
608
  */
609
  public function copyDirectory($directory, $destination, $options = null)
617
  // If the destination directory does not actually exist, we will go ahead and
618
  // create it recursively, which just gets the destination prepared to copy
619
  // the files over. Once we make the directory we'll proceed the copying.
620
+ $this->ensureDirectoryExists($destination, 0777);
 
 
621
 
622
  $items = new FilesystemIterator($directory, $options);
623
 
654
  * The directory itself may be optionally preserved.
655
  *
656
  * @param string $directory
657
+ * @param bool $preserve
658
  * @return bool
659
  */
660
  public function deleteDirectory($directory, $preserve = false)
688
  return true;
689
  }
690
 
691
+ /**
692
+ * Remove all of the directories within a given directory.
693
+ *
694
+ * @param string $directory
695
+ * @return bool
696
+ */
697
+ public function deleteDirectories($directory)
698
+ {
699
+ $allDirectories = $this->directories($directory);
700
+
701
+ if (! empty($allDirectories)) {
702
+ foreach ($allDirectories as $directoryName) {
703
+ $this->deleteDirectory($directoryName);
704
+ }
705
+
706
+ return true;
707
+ }
708
+
709
+ return false;
710
+ }
711
+
712
  /**
713
  * Empty the specified directory of all files and folders.
714
  *
vendor/illuminate/filesystem/FilesystemAdapter.php CHANGED
@@ -2,26 +2,35 @@
2
 
3
  namespace Illuminate\Filesystem;
4
 
5
- use RuntimeException;
 
 
 
6
  use Illuminate\Http\File;
7
- use Illuminate\Support\Str;
8
- use InvalidArgumentException;
9
  use Illuminate\Http\UploadedFile;
 
10
  use Illuminate\Support\Collection;
 
 
 
 
11
  use League\Flysystem\AdapterInterface;
12
- use PHPUnit\Framework\Assert as PHPUnit;
13
- use League\Flysystem\FilesystemInterface;
14
  use League\Flysystem\AwsS3v3\AwsS3Adapter;
 
 
15
  use League\Flysystem\FileNotFoundException;
16
- use League\Flysystem\Adapter\Local as LocalAdapter;
17
- use Illuminate\Contracts\Filesystem\Cloud as CloudFilesystemContract;
18
- use Illuminate\Contracts\Filesystem\Filesystem as FilesystemContract;
19
- use Illuminate\Contracts\Filesystem\FileNotFoundException as ContractFileNotFoundException;
 
 
 
20
 
21
  /**
22
  * @mixin \League\Flysystem\FilesystemInterface
23
  */
24
- class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
25
  {
26
  /**
27
  * The Flysystem filesystem implementation.
@@ -44,27 +53,50 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
44
  /**
45
  * Assert that the given file exists.
46
  *
47
- * @param string $path
48
- * @return void
 
49
  */
50
- public function assertExists($path)
51
  {
52
- PHPUnit::assertTrue(
53
- $this->exists($path), "Unable to find a file at path [{$path}]."
54
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  /**
58
  * Assert that the given file does not exist.
59
  *
60
- * @param string $path
61
- * @return void
62
  */
63
  public function assertMissing($path)
64
  {
65
- PHPUnit::assertFalse(
66
- $this->exists($path), "Found unexpected file at path [{$path}]."
67
- );
 
 
 
 
 
 
68
  }
69
 
70
  /**
@@ -78,6 +110,17 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
78
  return $this->driver->has($path);
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
81
  /**
82
  * Get the full path for the file at the given "short" path.
83
  *
@@ -86,7 +129,13 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
86
  */
87
  public function path($path)
88
  {
89
- return $this->driver->getAdapter()->getPathPrefix().$path;
 
 
 
 
 
 
90
  }
91
 
92
  /**
@@ -102,23 +151,81 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
102
  try {
103
  return $this->driver->read($path);
104
  } catch (FileNotFoundException $e) {
105
- throw new ContractFileNotFoundException($path, $e->getCode(), $e);
106
  }
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  /**
110
  * Write the contents of a file.
111
  *
112
  * @param string $path
113
  * @param string|resource $contents
114
- * @param array $options
115
  * @return bool
116
  */
117
  public function put($path, $contents, $options = [])
118
  {
119
- if (is_string($options)) {
120
- $options = ['visibility' => $options];
121
- }
122
 
123
  // If the given contents is actually a file or uploaded file instance than we will
124
  // automatically store the file using a stream. This provides a convenient path
@@ -128,6 +235,10 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
128
  return $this->putFile($path, $contents, $options);
129
  }
130
 
 
 
 
 
131
  return is_resource($contents)
132
  ? $this->driver->putStream($path, $contents, $options)
133
  : $this->driver->put($path, $contents, $options);
@@ -137,12 +248,14 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
137
  * Store the uploaded file on the disk.
138
  *
139
  * @param string $path
140
- * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile $file
141
- * @param array $options
142
  * @return string|false
143
  */
144
  public function putFile($path, $file, $options = [])
145
  {
 
 
146
  return $this->putFileAs($path, $file, $file->hashName(), $options);
147
  }
148
 
@@ -150,14 +263,14 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
150
  * Store the uploaded file on the disk with a given name.
151
  *
152
  * @param string $path
153
- * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile $file
154
  * @param string $name
155
- * @param array $options
156
  * @return string|false
157
  */
158
  public function putFileAs($path, $file, $name, $options = [])
159
  {
160
- $stream = fopen($file->getRealPath(), 'r+');
161
 
162
  // Next, we will format the path of the file and store the file using a stream since
163
  // they provide better performance than alternatives. Once we write the file this
@@ -193,7 +306,7 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
193
  *
194
  * @param string $path
195
  * @param string $visibility
196
- * @return void
197
  */
198
  public function setVisibility($path, $visibility)
199
  {
@@ -206,7 +319,7 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
206
  * @param string $path
207
  * @param string $data
208
  * @param string $separator
209
- * @return int
210
  */
211
  public function prepend($path, $data, $separator = PHP_EOL)
212
  {
@@ -223,7 +336,7 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
223
  * @param string $path
224
  * @param string $data
225
  * @param string $separator
226
- * @return int
227
  */
228
  public function append($path, $data, $separator = PHP_EOL)
229
  {
@@ -321,15 +434,25 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
321
  *
322
  * @param string $path
323
  * @return string
 
 
324
  */
325
  public function url($path)
326
  {
327
  $adapter = $this->driver->getAdapter();
328
 
 
 
 
 
329
  if (method_exists($adapter, 'getUrl')) {
330
  return $adapter->getUrl($path);
 
 
331
  } elseif ($adapter instanceof AwsS3Adapter) {
332
  return $this->getAwsUrl($adapter, $path);
 
 
333
  } elseif ($adapter instanceof LocalAdapter) {
334
  return $this->getLocalUrl($path);
335
  } else {
@@ -337,6 +460,30 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
337
  }
338
  }
339
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  /**
341
  * Get the URL for the file at the given path.
342
  *
@@ -346,11 +493,33 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
346
  */
347
  protected function getAwsUrl($adapter, $path)
348
  {
 
 
 
 
 
 
 
349
  return $adapter->getClient()->getObjectUrl(
350
  $adapter->getBucket(), $adapter->getPathPrefix().$path
351
  );
352
  }
353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  /**
355
  * Get the URL for the file at the given path.
356
  *
@@ -365,7 +534,7 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
365
  // it as the base URL instead of the default path. This allows the developer to
366
  // have full control over the base path for this filesystem's generated URLs.
367
  if ($config->has('url')) {
368
- return rtrim($config->get('url'), '/').'/'.ltrim($path, '/');
369
  }
370
 
371
  $path = '/storage/'.$path;
@@ -375,9 +544,9 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
375
  // are really supposed to use. We will remove the public from this path here.
376
  if (Str::contains($path, '/storage/public/')) {
377
  return Str::replaceFirst('/public/', '/', $path);
378
- } else {
379
- return $path;
380
  }
 
 
381
  }
382
 
383
  /**
@@ -387,17 +556,37 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
387
  * @param \DateTimeInterface $expiration
388
  * @param array $options
389
  * @return string
 
 
390
  */
391
  public function temporaryUrl($path, $expiration, array $options = [])
392
  {
393
  $adapter = $this->driver->getAdapter();
394
 
 
 
 
 
395
  if (method_exists($adapter, 'getTemporaryUrl')) {
396
  return $adapter->getTemporaryUrl($path, $expiration, $options);
397
- } elseif (! $adapter instanceof AwsS3Adapter) {
 
 
398
  throw new RuntimeException('This driver does not support creating temporary URLs.');
399
  }
 
400
 
 
 
 
 
 
 
 
 
 
 
 
401
  $client = $adapter->getClient();
402
 
403
  $command = $client->getCommand('GetObject', array_merge([
@@ -405,9 +594,47 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
405
  'Key' => $adapter->getPathPrefix().$path,
406
  ], $options));
407
 
408
- return (string) $client->createPresignedRequest(
409
  $command, $expiration
410
  )->getUri();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  }
412
 
413
  /**
@@ -482,6 +709,20 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
482
  return $this->driver->deleteDir($directory);
483
  }
484
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  /**
486
  * Get the Flysystem driver.
487
  *
@@ -529,7 +770,7 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
529
  return AdapterInterface::VISIBILITY_PRIVATE;
530
  }
531
 
532
- throw new InvalidArgumentException('Unknown visibility: '.$visibility);
533
  }
534
 
535
  /**
@@ -543,6 +784,6 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
543
  */
544
  public function __call($method, array $parameters)
545
  {
546
- return call_user_func_array([$this->driver, $method], $parameters);
547
  }
548
  }
2
 
3
  namespace Illuminate\Filesystem;
4
 
5
+ use Illuminate\Contracts\Filesystem\Cloud as CloudFilesystemContract;
6
+ use Illuminate\Contracts\Filesystem\FileExistsException as ContractFileExistsException;
7
+ use Illuminate\Contracts\Filesystem\FileNotFoundException as ContractFileNotFoundException;
8
+ use Illuminate\Contracts\Filesystem\Filesystem as FilesystemContract;
9
  use Illuminate\Http\File;
 
 
10
  use Illuminate\Http\UploadedFile;
11
+ use Illuminate\Support\Arr;
12
  use Illuminate\Support\Collection;
13
+ use Illuminate\Support\Str;
14
+ use InvalidArgumentException;
15
+ use League\Flysystem\Adapter\Ftp;
16
+ use League\Flysystem\Adapter\Local as LocalAdapter;
17
  use League\Flysystem\AdapterInterface;
 
 
18
  use League\Flysystem\AwsS3v3\AwsS3Adapter;
19
+ use League\Flysystem\Cached\CachedAdapter;
20
+ use League\Flysystem\FileExistsException;
21
  use League\Flysystem\FileNotFoundException;
22
+ use League\Flysystem\FilesystemInterface;
23
+ use League\Flysystem\Sftp\SftpAdapter as Sftp;
24
+ use PHPUnit\Framework\Assert as PHPUnit;
25
+ use Psr\Http\Message\StreamInterface;
26
+ use Psr\Http\Message\UriInterface;
27
+ use RuntimeException;
28
+ use Symfony\Component\HttpFoundation\StreamedResponse;
29
 
30
  /**
31
  * @mixin \League\Flysystem\FilesystemInterface
32
  */
33
+ class FilesystemAdapter implements CloudFilesystemContract
34
  {
35
  /**
36
  * The Flysystem filesystem implementation.
53
  /**
54
  * Assert that the given file exists.
55
  *
56
+ * @param string|array $path
57
+ * @param string|null $content
58
+ * @return $this
59
  */
60
+ public function assertExists($path, $content = null)
61
  {
62
+ $paths = Arr::wrap($path);
63
+
64
+ foreach ($paths as $path) {
65
+ PHPUnit::assertTrue(
66
+ $this->exists($path), "Unable to find a file at path [{$path}]."
67
+ );
68
+
69
+ if (! is_null($content)) {
70
+ $actual = $this->get($path);
71
+
72
+ PHPUnit::assertSame(
73
+ $content,
74
+ $actual,
75
+ "File [{$path}] was found, but content [{$actual}] does not match [{$content}]."
76
+ );
77
+ }
78
+ }
79
+
80
+ return $this;
81
  }
82
 
83
  /**
84
  * Assert that the given file does not exist.
85
  *
86
+ * @param string|array $path
87
+ * @return $this
88
  */
89
  public function assertMissing($path)
90
  {
91
+ $paths = Arr::wrap($path);
92
+
93
+ foreach ($paths as $path) {
94
+ PHPUnit::assertFalse(
95
+ $this->exists($path), "Found unexpected file at path [{$path}]."
96
+ );
97
+ }
98
+
99
+ return $this;
100
  }
101
 
102
  /**
110
  return $this->driver->has($path);
111
  }
112
 
113
+ /**
114
+ * Determine if a file or directory is missing.
115
+ *
116
+ * @param string $path
117
+ * @return bool
118
+ */
119
+ public function missing($path)
120
+ {
121
+ return ! $this->exists($path);
122
+ }
123
+
124
  /**
125
  * Get the full path for the file at the given "short" path.
126
  *
129
  */
130
  public function path($path)
131
  {
132
+ $adapter = $this->driver->getAdapter();
133
+
134
+ if ($adapter instanceof CachedAdapter) {
135
+ $adapter = $adapter->getAdapter();
136
+ }
137
+
138
+ return $adapter->getPathPrefix().$path;
139
  }
140
 
141
  /**
151
  try {
152
  return $this->driver->read($path);
153
  } catch (FileNotFoundException $e) {
154
+ throw new ContractFileNotFoundException($e->getMessage(), $e->getCode(), $e);
155
  }
156
  }
157
 
158
+ /**
159
+ * Create a streamed response for a given file.
160
+ *
161
+ * @param string $path
162
+ * @param string|null $name
163
+ * @param array|null $headers
164
+ * @param string|null $disposition
165
+ * @return \Symfony\Component\HttpFoundation\StreamedResponse
166
+ */
167
+ public function response($path, $name = null, array $headers = [], $disposition = 'inline')
168
+ {
169
+ $response = new StreamedResponse;
170
+
171
+ $filename = $name ?? basename($path);
172
+
173
+ $disposition = $response->headers->makeDisposition(
174
+ $disposition, $filename, $this->fallbackName($filename)
175
+ );
176
+
177
+ $response->headers->replace($headers + [
178
+ 'Content-Type' => $this->mimeType($path),
179
+ 'Content-Length' => $this->size($path),
180
+ 'Content-Disposition' => $disposition,
181
+ ]);
182
+
183
+ $response->setCallback(function () use ($path) {
184
+ $stream = $this->readStream($path);
185
+ fpassthru($stream);
186
+ fclose($stream);
187
+ });
188
+
189
+ return $response;
190
+ }
191
+
192
+ /**
193
+ * Create a streamed download response for a given file.
194
+ *
195
+ * @param string $path
196
+ * @param string|null $name
197
+ * @param array|null $headers
198
+ * @return \Symfony\Component\HttpFoundation\StreamedResponse
199
+ */
200
+ public function download($path, $name = null, array $headers = [])
201
+ {
202
+ return $this->response($path, $name, $headers, 'attachment');
203
+ }
204
+
205
+ /**
206
+ * Convert the string to ASCII characters that are equivalent to the given name.
207
+ *
208
+ * @param string $name
209
+ * @return string
210
+ */
211
+ protected function fallbackName($name)
212
+ {
213
+ return str_replace('%', '', Str::ascii($name));
214
+ }
215
+
216
  /**
217
  * Write the contents of a file.
218
  *
219
  * @param string $path
220
  * @param string|resource $contents
221
+ * @param mixed $options
222
  * @return bool
223
  */
224
  public function put($path, $contents, $options = [])
225
  {
226
+ $options = is_string($options)
227
+ ? ['visibility' => $options]
228
+ : (array) $options;
229
 
230
  // If the given contents is actually a file or uploaded file instance than we will
231
  // automatically store the file using a stream. This provides a convenient path
235
  return $this->putFile($path, $contents, $options);
236
  }
237
 
238
+ if ($contents instanceof StreamInterface) {
239
+ return $this->driver->putStream($path, $contents->detach(), $options);
240
+ }
241
+
242
  return is_resource($contents)
243
  ? $this->driver->putStream($path, $contents, $options)
244
  : $this->driver->put($path, $contents, $options);
248
  * Store the uploaded file on the disk.
249
  *
250
  * @param string $path
251
+ * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file
252
+ * @param mixed $options
253
  * @return string|false
254
  */
255
  public function putFile($path, $file, $options = [])
256
  {
257
+ $file = is_string($file) ? new File($file) : $file;
258
+
259
  return $this->putFileAs($path, $file, $file->hashName(), $options);
260
  }
261
 
263
  * Store the uploaded file on the disk with a given name.
264
  *
265
  * @param string $path
266
+ * @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file
267
  * @param string $name
268
+ * @param mixed $options
269
  * @return string|false
270
  */
271
  public function putFileAs($path, $file, $name, $options = [])
272
  {
273
+ $stream = fopen(is_string($file) ? $file : $file->getRealPath(), 'r');
274
 
275
  // Next, we will format the path of the file and store the file using a stream since
276
  // they provide better performance than alternatives. Once we write the file this
306
  *
307
  * @param string $path
308
  * @param string $visibility
309
+ * @return bool
310
  */
311
  public function setVisibility($path, $visibility)
312
  {
319
  * @param string $path
320
  * @param string $data
321
  * @param string $separator
322
+ * @return bool
323
  */
324
  public function prepend($path, $data, $separator = PHP_EOL)
325
  {
336
  * @param string $path
337
  * @param string $data
338
  * @param string $separator
339
+ * @return bool
340
  */
341
  public function append($path, $data, $separator = PHP_EOL)
342
  {
434
  *
435
  * @param string $path
436
  * @return string
437
+ *
438
+ * @throws \RuntimeException
439
  */
440
  public function url($path)
441
  {
442
  $adapter = $this->driver->getAdapter();
443
 
444
+ if ($adapter instanceof CachedAdapter) {
445
+ $adapter = $adapter->getAdapter();
446
+ }
447
+
448
  if (method_exists($adapter, 'getUrl')) {
449
  return $adapter->getUrl($path);
450
+ } elseif (method_exists($this->driver, 'getUrl')) {
451
+ return $this->driver->getUrl($path);
452
  } elseif ($adapter instanceof AwsS3Adapter) {
453
  return $this->getAwsUrl($adapter, $path);
454
+ } elseif ($adapter instanceof Ftp || $adapter instanceof Sftp) {
455
+ return $this->getFtpUrl($path);
456
  } elseif ($adapter instanceof LocalAdapter) {
457
  return $this->getLocalUrl($path);
458
  } else {
460
  }
461
  }
462
 
463
+ /**
464
+ * {@inheritdoc}
465
+ */
466
+ public function readStream($path)
467
+ {
468
+ try {
469
+ return $this->driver->readStream($path) ?: null;
470
+ } catch (FileNotFoundException $e) {
471
+ throw new ContractFileNotFoundException($e->getMessage(), $e->getCode(), $e);
472
+ }
473
+ }
474
+
475
+ /**
476
+ * {@inheritdoc}
477
+ */
478
+ public function writeStream($path, $resource, array $options = [])
479
+ {
480
+ try {
481
+ return $this->driver->writeStream($path, $resource, $options);
482
+ } catch (FileExistsException $e) {
483
+ throw new ContractFileExistsException($e->getMessage(), $e->getCode(), $e);
484
+ }
485
+ }
486
+
487
  /**
488
  * Get the URL for the file at the given path.
489
  *
493
  */
494
  protected function getAwsUrl($adapter, $path)
495
  {
496
+ // If an explicit base URL has been set on the disk configuration then we will use
497
+ // it as the base URL instead of the default path. This allows the developer to
498
+ // have full control over the base path for this filesystem's generated URLs.
499
+ if (! is_null($url = $this->driver->getConfig()->get('url'))) {
500
+ return $this->concatPathToUrl($url, $adapter->getPathPrefix().$path);
501
+ }
502
+
503
  return $adapter->getClient()->getObjectUrl(
504
  $adapter->getBucket(), $adapter->getPathPrefix().$path
505
  );
506
  }
507
 
508
+ /**
509
+ * Get the URL for the file at the given path.
510
+ *
511
+ * @param string $path
512
+ * @return string
513
+ */
514
+ protected function getFtpUrl($path)
515
+ {
516
+ $config = $this->driver->getConfig();
517
+
518
+ return $config->has('url')
519
+ ? $this->concatPathToUrl($config->get('url'), $path)
520
+ : $path;
521
+ }
522
+
523
  /**
524
  * Get the URL for the file at the given path.
525
  *
534
  // it as the base URL instead of the default path. This allows the developer to
535
  // have full control over the base path for this filesystem's generated URLs.
536
  if ($config->has('url')) {
537
+ return $this->concatPathToUrl($config->get('url'), $path);
538
  }
539
 
540
  $path = '/storage/'.$path;
544
  // are really supposed to use. We will remove the public from this path here.
545
  if (Str::contains($path, '/storage/public/')) {
546
  return Str::replaceFirst('/public/', '/', $path);
 
 
547
  }
548
+
549
+ return $path;
550
  }
551
 
552
  /**
556
  * @param \DateTimeInterface $expiration
557
  * @param array $options
558
  * @return string
559
+ *
560
+ * @throws \RuntimeException
561
  */
562
  public function temporaryUrl($path, $expiration, array $options = [])
563
  {
564
  $adapter = $this->driver->getAdapter();
565
 
566
+ if ($adapter instanceof CachedAdapter) {
567
+ $adapter = $adapter->getAdapter();
568
+ }
569
+
570
  if (method_exists($adapter, 'getTemporaryUrl')) {
571
  return $adapter->getTemporaryUrl($path, $expiration, $options);
572
+ } elseif ($adapter instanceof AwsS3Adapter) {
573
+ return $this->getAwsTemporaryUrl($adapter, $path, $expiration, $options);
574
+ } else {
575
  throw new RuntimeException('This driver does not support creating temporary URLs.');
576
  }
577
+ }
578
 
579
+ /**
580
+ * Get a temporary URL for the file at the given path.
581
+ *
582
+ * @param \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter
583
+ * @param string $path
584
+ * @param \DateTimeInterface $expiration
585
+ * @param array $options
586
+ * @return string
587
+ */
588
+ public function getAwsTemporaryUrl($adapter, $path, $expiration, $options)
589
+ {
590
  $client = $adapter->getClient();
591
 
592
  $command = $client->getCommand('GetObject', array_merge([
594
  'Key' => $adapter->getPathPrefix().$path,
595
  ], $options));
596
 
597
+ $uri = $client->createPresignedRequest(
598
  $command, $expiration
599
  )->getUri();
600
+
601
+ // If an explicit base URL has been set on the disk configuration then we will use
602
+ // it as the base URL instead of the default path. This allows the developer to
603
+ // have full control over the base path for this filesystem's generated URLs.
604
+ if (! is_null($url = $this->driver->getConfig()->get('temporary_url'))) {
605
+ $uri = $this->replaceBaseUrl($uri, $url);
606
+ }
607
+
608
+ return (string) $uri;
609
+ }
610
+
611
+ /**
612
+ * Concatenate a path to a URL.
613
+ *
614
+ * @param string $url
615
+ * @param string $path
616
+ * @return string
617
+ */
618
+ protected function concatPathToUrl($url, $path)
619
+ {
620
+ return rtrim($url, '/').'/'.ltrim($path, '/');
621
+ }
622
+
623
+ /**
624
+ * Replace the scheme, host and port of the given UriInterface with values from the given URL.
625
+ *
626
+ * @param \Psr\Http\Message\UriInterface $uri
627
+ * @param string $url
628
+ * @return \Psr\Http\Message\UriInterface
629
+ */
630
+ protected function replaceBaseUrl($uri, $url)
631
+ {
632
+ $parsed = parse_url($url);
633
+
634
+ return $uri
635
+ ->withScheme($parsed['scheme'])
636
+ ->withHost($parsed['host'])
637
+ ->withPort($parsed['port'] ?? null);
638
  }
639
 
640
  /**
709
  return $this->driver->deleteDir($directory);
710
  }
711
 
712
+ /**
713
+ * Flush the Flysystem cache.
714
+ *
715
+ * @return void
716
+ */
717
+ public function flushCache()
718
+ {
719
+ $adapter = $this->driver->getAdapter();
720
+
721
+ if ($adapter instanceof CachedAdapter) {
722
+ $adapter->getCache()->flush();
723
+ }
724
+ }
725
+
726
  /**
727
  * Get the Flysystem driver.
728
  *
770
  return AdapterInterface::VISIBILITY_PRIVATE;
771
  }
772
 
773
+ throw new InvalidArgumentException("Unknown visibility: {$visibility}.");
774
  }
775
 
776
  /**
784
  */
785
  public function __call($method, array $parameters)
786
  {
787
+ return $this->driver->{$method}(...array_values($parameters));
788
  }
789
  }
vendor/illuminate/filesystem/FilesystemManager.php CHANGED
@@ -2,19 +2,20 @@
2
 
3
  namespace Illuminate\Filesystem;
4
 
5
- use Closure;
6
  use Aws\S3\S3Client;
7
- use OpenCloud\Rackspace;
 
8
  use Illuminate\Support\Arr;
9
  use InvalidArgumentException;
10
- use League\Flysystem\AdapterInterface;
11
- use League\Flysystem\FilesystemInterface;
12
- use League\Flysystem\Filesystem as Flysystem;
13
  use League\Flysystem\Adapter\Ftp as FtpAdapter;
14
- use League\Flysystem\Rackspace\RackspaceAdapter;
15
  use League\Flysystem\Adapter\Local as LocalAdapter;
 
16
  use League\Flysystem\AwsS3v3\AwsS3Adapter as S3Adapter;
17
- use Illuminate\Contracts\Filesystem\Factory as FactoryContract;
 
 
 
 
18
 
19
  /**
20
  * @mixin \Illuminate\Contracts\Filesystem\Filesystem
@@ -56,7 +57,7 @@ class FilesystemManager implements FactoryContract
56
  /**
57
  * Get a filesystem instance.
58
  *
59
- * @param string $name
60
  * @return \Illuminate\Contracts\Filesystem\Filesystem
61
  */
62
  public function drive($name = null)
@@ -67,7 +68,7 @@ class FilesystemManager implements FactoryContract
67
  /**
68
  * Get a filesystem instance.
69
  *
70
- * @param string $name
71
  * @return \Illuminate\Contracts\Filesystem\Filesystem
72
  */
73
  public function disk($name = null)
@@ -97,7 +98,7 @@ class FilesystemManager implements FactoryContract
97
  */
98
  protected function get($name)
99
  {
100
- return isset($this->disks[$name]) ? $this->disks[$name] : $this->resolve($name);
101
  }
102
 
103
  /**
@@ -112,17 +113,23 @@ class FilesystemManager implements FactoryContract
112
  {
113
  $config = $this->getConfig($name);
114
 
115
- if (isset($this->customCreators[$config['driver']])) {
 
 
 
 
 
 
116
  return $this->callCustomCreator($config);
117
  }
118
 
119
- $driverMethod = 'create'.ucfirst($config['driver']).'Driver';
120
 
121
- if (method_exists($this, $driverMethod)) {
122
- return $this->{$driverMethod}($config);
123
- } else {
124
- throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
125
  }
 
 
126
  }
127
 
128
  /**
@@ -150,14 +157,14 @@ class FilesystemManager implements FactoryContract
150
  */
151
  public function createLocalDriver(array $config)
152
  {
153
- $permissions = isset($config['permissions']) ? $config['permissions'] : [];
154
 
155
- $links = Arr::get($config, 'links') === 'skip'
156
  ? LocalAdapter::SKIP_LINKS
157
  : LocalAdapter::DISALLOW_LINKS;
158
 
159
  return $this->adapt($this->createFlysystem(new LocalAdapter(
160
- $config['root'], LOCK_EX, $links, $permissions
161
  ), $config));
162
  }
163
 
@@ -169,12 +176,21 @@ class FilesystemManager implements FactoryContract
169
  */
170
  public function createFtpDriver(array $config)
171
  {
172
- $ftpConfig = Arr::only($config, [
173
- 'host', 'username', 'password', 'port', 'root', 'passive', 'ssl', 'timeout',
174
- ]);
 
175
 
 
 
 
 
 
 
 
 
176
  return $this->adapt($this->createFlysystem(
177
- new FtpAdapter($ftpConfig), $config
178
  ));
179
  }
180
 
@@ -188,12 +204,14 @@ class FilesystemManager implements FactoryContract
188
  {
189
  $s3Config = $this->formatS3Config($config);
190
 
191
- $root = isset($s3Config['root']) ? $s3Config['root'] : null;
192
 
193
- $options = isset($config['options']) ? $config['options'] : [];
 
 
194
 
195
  return $this->adapt($this->createFlysystem(
196
- new S3Adapter(new S3Client($s3Config), $s3Config['bucket'], $root, $options), $config
197
  ));
198
  }
199
 
@@ -207,60 +225,52 @@ class FilesystemManager implements FactoryContract
207
  {
208
  $config += ['version' => 'latest'];
209
 
210
- if ($config['key'] && $config['secret']) {
211
- $config['credentials'] = Arr::only($config, ['key', 'secret']);
212
  }
213
 
214
  return $config;
215
  }
216
 
217
  /**
218
- * Create an instance of the Rackspace driver.
219
  *
 
220
  * @param array $config
221
- * @return \Illuminate\Contracts\Filesystem\Cloud
222
  */
223
- public function createRackspaceDriver(array $config)
224
  {
225
- $client = new Rackspace($config['endpoint'], [
226
- 'username' => $config['username'], 'apiKey' => $config['key'],
227
- ]);
228
 
229
- $root = isset($config['root']) ? $config['root'] : null;
230
-
231
- return $this->adapt($this->createFlysystem(
232
- new RackspaceAdapter($this->getRackspaceContainer($client, $config), $root), $config
233
- ));
234
- }
235
-
236
- /**
237
- * Get the Rackspace Cloud Files container.
238
- *
239
- * @param \OpenCloud\Rackspace $client
240
- * @param array $config
241
- * @return \OpenCloud\ObjectStore\Resource\Container
242
- */
243
- protected function getRackspaceContainer(Rackspace $client, array $config)
244
- {
245
- $urlType = Arr::get($config, 'url_type');
246
 
247
- $store = $client->objectStoreService('cloudFiles', $config['region'], $urlType);
 
 
248
 
249
- return $store->getContainer($config['container']);
250
  }
251
 
252
  /**
253
- * Create a Flysystem instance with the given adapter.
254
  *
255
- * @param \League\Flysystem\AdapterInterface $adapter
256
- * @param array $config
257
- * @return \League\Flysystem\FlysystemInterface
 
258
  */
259
- protected function createFlysystem(AdapterInterface $adapter, array $config)
260
  {
261
- $config = Arr::only($config, ['visibility', 'disable_asserts', 'url']);
 
 
262
 
263
- return new Flysystem($adapter, count($config) > 0 ? $config : null);
 
 
 
 
264
  }
265
 
266
  /**
@@ -279,11 +289,13 @@ class FilesystemManager implements FactoryContract
279
  *
280
  * @param string $name
281
  * @param mixed $disk
282
- * @return void
283
  */
284
  public function set($name, $disk)
285
  {
286
  $this->disks[$name] = $disk;
 
 
287
  }
288
 
289
  /**
@@ -294,7 +306,7 @@ class FilesystemManager implements FactoryContract
294
  */
295
  protected function getConfig($name)
296
  {
297
- return $this->app['config']["filesystems.disks.{$name}"];
298
  }
299
 
300
  /**
@@ -314,13 +326,41 @@ class FilesystemManager implements FactoryContract
314
  */
315
  public function getDefaultCloudDriver()
316
  {
317
- return $this->app['config']['filesystems.cloud'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  }
319
 
320
  /**
321
  * Register a custom driver creator Closure.
322
  *
323
- * @param string $driver
324
  * @param \Closure $callback
325
  * @return $this
326
  */
@@ -335,7 +375,7 @@ class FilesystemManager implements FactoryContract
335
  * Dynamically call the default driver instance.
336
  *
337
  * @param string $method
338
- * @param array $parameters
339
  * @return mixed
340
  */
341
  public function __call($method, $parameters)
2
 
3
  namespace Illuminate\Filesystem;
4
 
 
5
  use Aws\S3\S3Client;
6
+ use Closure;
7
+ use Illuminate\Contracts\Filesystem\Factory as FactoryContract;
8
  use Illuminate\Support\Arr;
9
  use InvalidArgumentException;
 
 
 
10
  use League\Flysystem\Adapter\Ftp as FtpAdapter;
 
11
  use League\Flysystem\Adapter\Local as LocalAdapter;
12
+ use League\Flysystem\AdapterInterface;
13
  use League\Flysystem\AwsS3v3\AwsS3Adapter as S3Adapter;
14
+ use League\Flysystem\Cached\CachedAdapter;
15
+ use League\Flysystem\Cached\Storage\Memory as MemoryStore;
16
+ use League\Flysystem\Filesystem as Flysystem;
17
+ use League\Flysystem\FilesystemInterface;
18
+ use League\Flysystem\Sftp\SftpAdapter;
19
 
20
  /**
21
  * @mixin \Illuminate\Contracts\Filesystem\Filesystem
57
  /**
58
  * Get a filesystem instance.
59
  *
60
+ * @param string|null $name
61
  * @return \Illuminate\Contracts\Filesystem\Filesystem
62
  */
63
  public function drive($name = null)
68
  /**
69
  * Get a filesystem instance.
70
  *
71
+ * @param string|null $name
72
  * @return \Illuminate\Contracts\Filesystem\Filesystem
73
  */
74
  public function disk($name = null)
98
  */
99
  protected function get($name)
100
  {
101
+ return $this->disks[$name] ?? $this->resolve($name);
102
  }
103
 
104
  /**
113
  {
114
  $config = $this->getConfig($name);
115
 
116
+ if (empty($config['driver'])) {
117
+ throw new InvalidArgumentException("Disk [{$name}] does not have a configured driver.");
118
+ }
119
+
120
+ $name = $config['driver'];
121
+
122
+ if (isset($this->customCreators[$name])) {
123
  return $this->callCustomCreator($config);
124
  }
125
 
126
+ $driverMethod = 'create'.ucfirst($name).'Driver';
127
 
128
+ if (! method_exists($this, $driverMethod)) {
129
+ throw new InvalidArgumentException("Driver [{$name}] is not supported.");
 
 
130
  }
131
+
132
+ return $this->{$driverMethod}($config);
133
  }
134
 
135
  /**
157
  */
158
  public function createLocalDriver(array $config)
159
  {
160
+ $permissions = $config['permissions'] ?? [];
161
 
162
+ $links = ($config['links'] ?? null) === 'skip'
163
  ? LocalAdapter::SKIP_LINKS
164
  : LocalAdapter::DISALLOW_LINKS;
165
 
166
  return $this->adapt($this->createFlysystem(new LocalAdapter(
167
+ $config['root'], $config['lock'] ?? LOCK_EX, $links, $permissions
168
  ), $config));
169
  }
170
 
176
  */
177
  public function createFtpDriver(array $config)
178
  {
179
+ return $this->adapt($this->createFlysystem(
180
+ new FtpAdapter($config), $config
181
+ ));
182
+ }
183
 
184
+ /**
185
+ * Create an instance of the sftp driver.
186
+ *
187
+ * @param array $config
188
+ * @return \Illuminate\Contracts\Filesystem\Filesystem
189
+ */
190
+ public function createSftpDriver(array $config)
191
+ {
192
  return $this->adapt($this->createFlysystem(
193
+ new SftpAdapter($config), $config
194
  ));
195
  }
196
 
204
  {
205
  $s3Config = $this->formatS3Config($config);
206
 
207
+ $root = $s3Config['root'] ?? null;
208
 
209
+ $options = $config['options'] ?? [];
210
+
211
+ $streamReads = $config['stream_reads'] ?? false;
212
 
213
  return $this->adapt($this->createFlysystem(
214
+ new S3Adapter(new S3Client($s3Config), $s3Config['bucket'], $root, $options, $streamReads), $config
215
  ));
216
  }
217
 
225
  {
226
  $config += ['version' => 'latest'];
227
 
228
+ if (! empty($config['key']) && ! empty($config['secret'])) {
229
+ $config['credentials'] = Arr::only($config, ['key', 'secret', 'token']);
230
  }
231
 
232
  return $config;
233
  }
234
 
235
  /**
236
+ * Create a Flysystem instance with the given adapter.
237
  *
238
+ * @param \League\Flysystem\AdapterInterface $adapter
239
  * @param array $config
240
+ * @return \League\Flysystem\FilesystemInterface
241
  */
242
+ protected function createFlysystem(AdapterInterface $adapter, array $config)
243
  {
244
+ $cache = Arr::pull($config, 'cache');
 
 
245
 
246
+ $config = Arr::only($config, ['visibility', 'disable_asserts', 'url', 'temporary_url']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
 
248
+ if ($cache) {
249
+ $adapter = new CachedAdapter($adapter, $this->createCacheStore($cache));
250
+ }
251
 
252
+ return new Flysystem($adapter, count($config) > 0 ? $config : null);
253
  }
254
 
255
  /**
256
+ * Create a cache store instance.
257
  *
258
+ * @param mixed $config
259
+ * @return \League\Flysystem\Cached\CacheInterface
260
+ *
261
+ * @throws \InvalidArgumentException
262
  */
263
+ protected function createCacheStore($config)
264
  {
265
+ if ($config === true) {
266
+ return new MemoryStore;
267
+ }
268
 
269
+ return new Cache(
270
+ $this->app['cache']->store($config['store']),
271
+ $config['prefix'] ?? 'flysystem',
272
+ $config['expire'] ?? null
273
+ );
274
  }
275
 
276
  /**
289
  *
290
  * @param string $name
291
  * @param mixed $disk
292
+ * @return $this
293
  */
294
  public function set($name, $disk)
295
  {
296
  $this->disks[$name] = $disk;
297
+
298
+ return $this;
299
  }
300
 
301
  /**
306
  */
307
  protected function getConfig($name)
308
  {
309
+ return $this->app['config']["filesystems.disks.{$name}"] ?: [];
310
  }
311
 
312
  /**
326
  */
327
  public function getDefaultCloudDriver()
328
  {
329
+ return $this->app['config']['filesystems.cloud'] ?? 's3';
330
+ }
331
+
332
+ /**
333
+ * Unset the given disk instances.
334
+ *
335
+ * @param array|string $disk
336
+ * @return $this
337
+ */
338
+ public function forgetDisk($disk)
339
+ {
340
+ foreach ((array) $disk as $diskName) {
341
+ unset($this->disks[$diskName]);
342
+ }
343
+
344
+ return $this;
345
+ }
346
+
347
+ /**
348
+ * Disconnect the given disk and remove from local cache.
349
+ *
350
+ * @param string|null $name
351
+ * @return void
352
+ */
353
+ public function purge($name = null)
354
+ {
355
+ $name = $name ?? $this->getDefaultDriver();
356
+
357
+ unset($this->disks[$name]);
358
  }
359
 
360
  /**
361
  * Register a custom driver creator Closure.
362
  *
363
+ * @param string $driver
364
  * @param \Closure $callback
365
  * @return $this
366
  */
375
  * Dynamically call the default driver instance.
376
  *
377
  * @param string $method
378
+ * @param array $parameters
379
  * @return mixed
380
  */
381
  public function __call($method, $parameters)
vendor/illuminate/filesystem/FilesystemServiceProvider.php CHANGED
@@ -39,12 +39,12 @@ class FilesystemServiceProvider extends ServiceProvider
39
  {
40
  $this->registerManager();
41
 
42
- $this->app->singleton('filesystem.disk', function () {
43
- return $this->app['filesystem']->disk($this->getDefaultDriver());
44
  });
45
 
46
- $this->app->singleton('filesystem.cloud', function () {
47
- return $this->app['filesystem']->disk($this->getCloudDriver());
48
  });
49
  }
50
 
@@ -55,8 +55,8 @@ class FilesystemServiceProvider extends ServiceProvider
55
  */
56
  protected function registerManager()
57
  {
58
- $this->app->singleton('filesystem', function () {
59
- return new FilesystemManager($this->app);
60
  });
61
  }
62
 
39
  {
40
  $this->registerManager();
41
 
42
+ $this->app->singleton('filesystem.disk', function ($app) {
43
+ return $app['filesystem']->disk($this->getDefaultDriver());
44
  });
45
 
46
+ $this->app->singleton('filesystem.cloud', function ($app) {
47
+ return $app['filesystem']->disk($this->getCloudDriver());
48
  });
49
  }
50
 
55
  */
56
  protected function registerManager()
57
  {
58
+ $this->app->singleton('filesystem', function ($app) {
59
+ return new FilesystemManager($app);
60
  });
61
  }
62
 
vendor/illuminate/filesystem/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Taylor Otwell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
vendor/illuminate/filesystem/LockableFile.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Filesystem;
4
+
5
+ use Exception;
6
+ use Illuminate\Contracts\Filesystem\LockTimeoutException;
7
+
8
+ class LockableFile
9
+ {
10
+ /**
11
+ * The file resource.
12
+ *
13
+ * @var resource
14
+ */
15
+ protected $handle;
16
+
17
+ /**
18
+ * The file path.
19
+ *
20
+ * @var string
21
+ */
22
+ protected $path;
23
+
24
+ /**
25
+ * Indicates if the file is locked.
26
+ *
27
+ * @var bool
28
+ */
29
+ protected $isLocked = false;
30
+
31
+ /**
32
+ * Create a new File instance.
33
+ *
34
+ * @param string $path
35
+ * @param string $mode
36
+ * @return void
37
+ */
38
+ public function __construct($path, $mode)
39
+ {
40
+ $this->path = $path;
41
+
42
+ $this->ensureDirectoryExists($path);
43
+ $this->createResource($path, $mode);
44
+ }
45
+
46
+ /**
47
+ * Create the file's directory if necessary.
48
+ *
49
+ * @param string $path
50
+ * @return void
51
+ */
52
+ protected function ensureDirectoryExists($path)
53
+ {
54
+ if (! file_exists(dirname($path))) {
55
+ @mkdir(dirname($path), 0777, true);
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Create the file resource.
61
+ *
62
+ * @param string $path
63
+ * @param string $mode
64
+ * @return void
65
+ */
66
+ protected function createResource($path, $mode)
67
+ {
68
+ $this->handle = @fopen($path, $mode);
69
+
70
+ if (! $this->handle) {
71
+ throw new Exception('Unable to create lockable file: '.$path.'. Please ensure you have permission to create files in this location.');
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Read the file contents.
77
+ *
78
+ * @param int|null $length
79
+ * @return string
80
+ */
81
+ public function read($length = null)
82
+ {
83
+ clearstatcache(true, $this->path);
84
+
85
+ return fread($this->handle, $length ?? ($this->size() ?: 1));
86
+ }
87
+
88
+ /**
89
+ * Get the file size.
90
+ *
91
+ * @return int
92
+ */
93
+ public function size()
94
+ {
95
+ return filesize($this->path);
96
+ }
97
+
98
+ /**
99
+ * Write to the file.
100
+ *
101
+ * @param string $contents
102
+ * @return string
103
+ */
104
+ public function write($contents)
105
+ {
106
+ fwrite($this->handle, $contents);
107
+
108
+ fflush($this->handle);
109
+
110
+ return $this;
111
+ }
112
+
113
+ /**
114
+ * Truncate the file.
115
+ *
116
+ * @return $this
117
+ */
118
+ public function truncate()
119
+ {
120
+ rewind($this->handle);
121
+
122
+ ftruncate($this->handle, 0);
123
+
124
+ return $this;
125
+ }
126
+
127
+ /**
128
+ * Get a shared lock on the file.
129
+ *
130
+ * @param bool $block
131
+ * @return $this
132
+ */
133
+ public function getSharedLock($block = false)
134
+ {
135
+ if (! flock($this->handle, LOCK_SH | ($block ? 0 : LOCK_NB))) {
136
+ throw new LockTimeoutException("Unable to acquire file lock at path [{$this->path}].");
137
+ }
138
+
139
+ $this->isLocked = true;
140
+
141
+ return $this;
142
+ }
143
+
144
+ /**
145
+ * Get an exclusive lock on the file.
146
+ *
147
+ * @param bool $block
148
+ * @return bool
149
+ */
150
+ public function getExclusiveLock($block = false)
151
+ {
152
+ if (! flock($this->handle, LOCK_EX | ($block ? 0 : LOCK_NB))) {
153
+ throw new LockTimeoutException("Unable to acquire file lock at path [{$this->path}].");
154
+ }
155
+
156
+ $this->isLocked = true;
157
+
158
+ return $this;
159
+ }
160
+
161
+ /**
162
+ * Release the lock on the file.
163
+ *
164
+ * @return $this
165
+ */
166
+ public function releaseLock()
167
+ {
168
+ flock($this->handle, LOCK_UN);
169
+
170
+ $this->isLocked = false;
171
+
172
+ return $this;
173
+ }
174
+
175
+ /**
176
+ * Close the file.
177
+ *
178
+ * @return bool
179
+ */
180
+ public function close()
181
+ {
182
+ if ($this->isLocked) {
183
+ $this->releaseLock();
184
+ }
185
+
186
+ return fclose($this->handle);
187
+ }
188
+ }
vendor/illuminate/filesystem/composer.json CHANGED
@@ -14,10 +14,12 @@
14
  }
15
  ],
16
  "require": {
17
- "php": ">=5.6.4",
18
- "illuminate/contracts": "5.4.*",
19
- "illuminate/support": "5.4.*",
20
- "symfony/finder": "~3.2"
 
 
21
  },
22
  "autoload": {
23
  "psr-4": {
@@ -26,13 +28,19 @@
26
  },
27
  "extra": {
28
  "branch-alias": {
29
- "dev-master": "5.4-dev"
30
  }
31
  },
32
  "suggest": {
33
- "league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).",
34
- "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).",
35
- "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0)."
 
 
 
 
 
 
36
  },
37
  "config": {
38
  "sort-packages": true
14
  }
15
  ],
16
  "require": {
17
+ "php": "^7.3|^8.0",
18
+ "illuminate/collections": "^8.0",
19
+ "illuminate/contracts": "^8.0",
20
+ "illuminate/macroable": "^8.0",
21
+ "illuminate/support": "^8.0",
22
+ "symfony/finder": "^5.1.4"
23
  },
24
  "autoload": {
25
  "psr-4": {
28
  },
29
  "extra": {
30
  "branch-alias": {
31
+ "dev-master": "8.x-dev"
32
  }
33
  },
34
  "suggest": {
35
+ "ext-ftp": "Required to use the Flysystem FTP driver.",
36
+ "illuminate/http": "Required for handling uploaded files (^7.0).",
37
+ "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).",
38
+ "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).",
39
+ "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).",
40
+ "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).",
41
+ "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
42
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).",
43
+ "symfony/mime": "Required to enable support for guessing extensions (^5.1.4)."
44
  },
45
  "config": {
46
  "sort-packages": true
vendor/illuminate/macroable/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Taylor Otwell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
vendor/illuminate/macroable/Traits/Macroable.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Traits;
4
+
5
+ use BadMethodCallException;
6
+ use Closure;
7
+ use ReflectionClass;
8
+ use ReflectionMethod;
9
+
10
+ trait Macroable
11
+ {
12
+ /**
13
+ * The registered string macros.
14
+ *
15
+ * @var array
16
+ */
17
+ protected static $macros = [];
18
+
19
+ /**
20
+ * Register a custom macro.
21
+ *
22
+ * @param string $name
23
+ * @param object|callable $macro
24
+ * @return void
25
+ */
26
+ public static function macro($name, $macro)
27
+ {
28
+ static::$macros[$name] = $macro;
29
+ }
30
+
31
+ /**
32
+ * Mix another object into the class.
33
+ *
34
+ * @param object $mixin
35
+ * @param bool $replace
36
+ * @return void
37
+ *
38
+ * @throws \ReflectionException
39
+ */
40
+ public static function mixin($mixin, $replace = true)
41
+ {
42
+ $methods = (new ReflectionClass($mixin))->getMethods(
43
+ ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED
44
+ );
45
+
46
+ foreach ($methods as $method) {
47
+ if ($replace || ! static::hasMacro($method->name)) {
48
+ $method->setAccessible(true);
49
+ static::macro($method->name, $method->invoke($mixin));
50
+ }
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Checks if macro is registered.
56
+ *
57
+ * @param string $name
58
+ * @return bool
59
+ */
60
+ public static function hasMacro($name)
61
+ {
62
+ return isset(static::$macros[$name]);
63
+ }
64
+
65
+ /**
66
+ * Dynamically handle calls to the class.
67
+ *
68
+ * @param string $method
69
+ * @param array $parameters
70
+ * @return mixed
71
+ *
72
+ * @throws \BadMethodCallException
73
+ */
74
+ public static function __callStatic($method, $parameters)
75
+ {
76
+ if (! static::hasMacro($method)) {
77
+ throw new BadMethodCallException(sprintf(
78
+ 'Method %s::%s does not exist.', static::class, $method
79
+ ));
80
+ }
81
+
82
+ $macro = static::$macros[$method];
83
+
84
+ if ($macro instanceof Closure) {
85
+ $macro = $macro->bindTo(null, static::class);
86
+ }
87
+
88
+ return $macro(...$parameters);
89
+ }
90
+
91
+ /**
92
+ * Dynamically handle calls to the class.
93
+ *
94
+ * @param string $method
95
+ * @param array $parameters
96
+ * @return mixed
97
+ *
98
+ * @throws \BadMethodCallException
99
+ */
100
+ public function __call($method, $parameters)
101
+ {
102
+ if (! static::hasMacro($method)) {
103
+ throw new BadMethodCallException(sprintf(
104
+ 'Method %s::%s does not exist.', static::class, $method
105
+ ));
106
+ }
107
+
108
+ $macro = static::$macros[$method];
109
+
110
+ if ($macro instanceof Closure) {
111
+ $macro = $macro->bindTo($this, static::class);
112
+ }
113
+
114
+ return $macro(...$parameters);
115
+ }
116
+ }
vendor/illuminate/macroable/composer.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "illuminate/macroable",
3
+ "description": "The Illuminate Macroable package.",
4
+ "license": "MIT",
5
+ "homepage": "https://laravel.com",
6
+ "support": {
7
+ "issues": "https://github.com/laravel/framework/issues",
8
+ "source": "https://github.com/laravel/framework"
9
+ },
10
+ "authors": [
11
+ {
12
+ "name": "Taylor Otwell",
13
+ "email": "taylor@laravel.com"
14
+ }
15
+ ],
16
+ "require": {
17
+ "php": "^7.3|^8.0"
18
+ },
19
+ "autoload": {
20
+ "psr-4": {
21
+ "Illuminate\\Support\\": ""
22
+ }
23
+ },
24
+ "extra": {
25
+ "branch-alias": {
26
+ "dev-master": "8.x-dev"
27
+ }
28
+ },
29
+ "config": {
30
+ "sort-packages": true
31
+ },
32
+ "minimum-stability": "dev"
33
+ }
vendor/illuminate/support/Carbon.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use Carbon\Carbon as BaseCarbon;
6
+ use Carbon\CarbonImmutable as BaseCarbonImmutable;
7
+
8
+ class Carbon extends BaseCarbon
9
+ {
10
+ /**
11
+ * {@inheritdoc}
12
+ */
13
+ public static function setTestNow($testNow = null)
14
+ {
15
+ BaseCarbon::setTestNow($testNow);
16
+ BaseCarbonImmutable::setTestNow($testNow);
17
+ }
18
+ }
vendor/illuminate/support/Composer.php CHANGED
@@ -3,9 +3,8 @@
3
  namespace Illuminate\Support;
4
 
5
  use Illuminate\Filesystem\Filesystem;
6
- use Symfony\Component\Process\Process;
7
- use Symfony\Component\Process\ProcessUtils;
8
  use Symfony\Component\Process\PhpExecutableFinder;
 
9
 
10
  class Composer
11
  {
@@ -19,7 +18,7 @@ class Composer
19
  /**
20
  * The working path to regenerate from.
21
  *
22
- * @var string
23
  */
24
  protected $workingPath;
25
 
@@ -39,50 +38,61 @@ class Composer
39
  /**
40
  * Regenerate the Composer autoloader files.
41
  *
42
- * @param string $extra
43
- * @return void
44
  */
45
  public function dumpAutoloads($extra = '')
46
  {
47
- $process = $this->getProcess();
48
 
49
- $process->setCommandLine(trim($this->findComposer().' dump-autoload '.$extra));
50
 
51
- $process->run();
52
  }
53
 
54
  /**
55
  * Regenerate the optimized Composer autoloader files.
56
  *
57
- * @return void
58
  */
59
  public function dumpOptimized()
60
  {
61
- $this->dumpAutoloads('--optimize');
62
  }
63
 
64
  /**
65
  * Get the composer command for the environment.
66
  *
67
- * @return string
68
  */
69
  protected function findComposer()
70
  {
71
  if ($this->files->exists($this->workingPath.'/composer.phar')) {
72
- return ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)).' composer.phar';
73
  }
74
 
75
- return 'composer';
 
 
 
 
 
 
 
 
 
 
76
  }
77
 
78
  /**
79
  * Get a new Symfony process instance.
80
  *
 
81
  * @return \Symfony\Component\Process\Process
82
  */
83
- protected function getProcess()
84
  {
85
- return (new Process('', $this->workingPath))->setTimeout(null);
86
  }
87
 
88
  /**
3
  namespace Illuminate\Support;
4
 
5
  use Illuminate\Filesystem\Filesystem;
 
 
6
  use Symfony\Component\Process\PhpExecutableFinder;
7
+ use Symfony\Component\Process\Process;
8
 
9
  class Composer
10
  {
18
  /**
19
  * The working path to regenerate from.
20
  *
21
+ * @var string|null
22
  */
23
  protected $workingPath;
24
 
38
  /**
39
  * Regenerate the Composer autoloader files.
40
  *
41
+ * @param string|array $extra
42
+ * @return int
43
  */
44
  public function dumpAutoloads($extra = '')
45
  {
46
+ $extra = $extra ? (array) $extra : [];
47
 
48
+ $command = array_merge($this->findComposer(), ['dump-autoload'], $extra);
49
 
50
+ return $this->getProcess($command)->run();
51
  }
52
 
53
  /**
54
  * Regenerate the optimized Composer autoloader files.
55
  *
56
+ * @return int
57
  */
58
  public function dumpOptimized()
59
  {
60
+ return $this->dumpAutoloads('--optimize');
61
  }
62
 
63
  /**
64
  * Get the composer command for the environment.
65
  *
66
+ * @return array
67
  */
68
  protected function findComposer()
69
  {
70
  if ($this->files->exists($this->workingPath.'/composer.phar')) {
71
+ return [$this->phpBinary(), 'composer.phar'];
72
  }
73
 
74
+ return ['composer'];
75
+ }
76
+
77
+ /**
78
+ * Get the PHP binary.
79
+ *
80
+ * @return string
81
+ */
82
+ protected function phpBinary()
83
+ {
84
+ return ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
85
  }
86
 
87
  /**
88
  * Get a new Symfony process instance.
89
  *
90
+ * @param array $command
91
  * @return \Symfony\Component\Process\Process
92
  */
93
+ protected function getProcess(array $command)
94
  {
95
+ return (new Process($command, $this->workingPath))->setTimeout(null);
96
  }
97
 
98
  /**
vendor/illuminate/support/ConfigurationUrlParser.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use InvalidArgumentException;
6
+
7
+ class ConfigurationUrlParser
8
+ {
9
+ /**
10
+ * The drivers aliases map.
11
+ *
12
+ * @var array
13
+ */
14
+ protected static $driverAliases = [
15
+ 'mssql' => 'sqlsrv',
16
+ 'mysql2' => 'mysql', // RDS
17
+ 'postgres' => 'pgsql',
18
+ 'postgresql' => 'pgsql',
19
+ 'sqlite3' => 'sqlite',
20
+ 'redis' => 'tcp',
21
+ 'rediss' => 'tls',
22
+ ];
23
+
24
+ /**
25
+ * Parse the database configuration, hydrating options using a database configuration URL if possible.
26
+ *
27
+ * @param array|string $config
28
+ * @return array
29
+ */
30
+ public function parseConfiguration($config)
31
+ {
32
+ if (is_string($config)) {
33
+ $config = ['url' => $config];
34
+ }
35
+
36
+ $url = Arr::pull($config, 'url');
37
+
38
+ if (! $url) {
39
+ return $config;
40
+ }
41
+
42
+ $rawComponents = $this->parseUrl($url);
43
+
44
+ $decodedComponents = $this->parseStringsToNativeTypes(
45
+ array_map('rawurldecode', $rawComponents)
46
+ );
47
+
48
+ return array_merge(
49
+ $config,
50
+ $this->getPrimaryOptions($decodedComponents),
51
+ $this->getQueryOptions($rawComponents)
52
+ );
53
+ }
54
+
55
+ /**
56
+ * Get the primary database connection options.
57
+ *
58
+ * @param array $url
59
+ * @return array
60
+ */
61
+ protected function getPrimaryOptions($url)
62
+ {
63
+ return array_filter([
64
+ 'driver' => $this->getDriver($url),
65
+ 'database' => $this->getDatabase($url),
66
+ 'host' => $url['host'] ?? null,
67
+ 'port' => $url['port'] ?? null,
68
+ 'username' => $url['user'] ?? null,
69
+ 'password' => $url['pass'] ?? null,
70
+ ], function ($value) {
71
+ return ! is_null($value);
72
+ });
73
+ }
74
+
75
+ /**
76
+ * Get the database driver from the URL.
77
+ *
78
+ * @param array $url
79
+ * @return string|null
80
+ */
81
+ protected function getDriver($url)
82
+ {
83
+ $alias = $url['scheme'] ?? null;
84
+
85
+ if (! $alias) {
86
+ return;
87
+ }
88
+
89
+ return static::$driverAliases[$alias] ?? $alias;
90
+ }
91
+
92
+ /**
93
+ * Get the database name from the URL.
94
+ *
95
+ * @param array $url
96
+ * @return string|null
97
+ */
98
+ protected function getDatabase($url)
99
+ {
100
+ $path = $url['path'] ?? null;
101
+
102
+ return $path && $path !== '/' ? substr($path, 1) : null;
103
+ }
104
+
105
+ /**
106
+ * Get all of the additional database options from the query string.
107
+ *
108
+ * @param array $url
109
+ * @return array
110
+ */
111
+ protected function getQueryOptions($url)
112
+ {
113
+ $queryString = $url['query'] ?? null;
114
+
115
+ if (! $queryString) {
116
+ return [];
117
+ }
118
+
119
+ $query = [];
120
+
121
+ parse_str($queryString, $query);
122
+
123
+ return $this->parseStringsToNativeTypes($query);
124
+ }
125
+
126
+ /**
127
+ * Parse the string URL to an array of components.
128
+ *
129
+ * @param string $url
130
+ * @return array
131
+ *
132
+ * @throws \InvalidArgumentException
133
+ */
134
+ protected function parseUrl($url)
135
+ {
136
+ $url = preg_replace('#^(sqlite3?):///#', '$1://null/', $url);
137
+
138
+ $parsedUrl = parse_url($url);
139
+
140
+ if ($parsedUrl === false) {
141
+ throw new InvalidArgumentException('The database configuration URL is malformed.');
142
+ }
143
+
144
+ return $parsedUrl;
145
+ }
146
+
147
+ /**
148
+ * Convert string casted values to their native types.
149
+ *
150
+ * @param mixed $value
151
+ * @return mixed
152
+ */
153
+ protected function parseStringsToNativeTypes($value)
154
+ {
155
+ if (is_array($value)) {
156
+ return array_map([$this, 'parseStringsToNativeTypes'], $value);
157
+ }
158
+
159
+ if (! is_string($value)) {
160
+ return $value;
161
+ }
162
+
163
+ $parsedValue = json_decode($value, true);
164
+
165
+ if (json_last_error() === JSON_ERROR_NONE) {
166
+ return $parsedValue;
167
+ }
168
+
169
+ return $value;
170
+ }
171
+
172
+ /**
173
+ * Get all of the current drivers' aliases.
174
+ *
175
+ * @return array
176
+ */
177
+ public static function getDriverAliases()
178
+ {
179
+ return static::$driverAliases;
180
+ }
181
+
182
+ /**
183
+ * Add the given driver alias to the driver aliases array.
184
+ *
185
+ * @param string $alias
186
+ * @param string $driver
187
+ * @return void
188
+ */
189
+ public static function addDriverAlias($alias, $driver)
190
+ {
191
+ static::$driverAliases[$alias] = $driver;
192
+ }
193
+ }
vendor/illuminate/support/DateFactory.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use Carbon\Factory;
6
+ use InvalidArgumentException;
7
+
8
+ /**
9
+ * @see https://carbon.nesbot.com/docs/
10
+ * @see https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Factory.php
11
+ *
12
+ * @method static Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null)
13
+ * @method static Carbon createFromDate($year = null, $month = null, $day = null, $tz = null)
14
+ * @method static Carbon|false createFromFormat($format, $time, $tz = null)
15
+ * @method static Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null)
16
+ * @method static Carbon createFromTimeString($time, $tz = null)
17
+ * @method static Carbon createFromTimestamp($timestamp, $tz = null)
18
+ * @method static Carbon createFromTimestampMs($timestamp, $tz = null)
19
+ * @method static Carbon createFromTimestampUTC($timestamp)
20
+ * @method static Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null)
21
+ * @method static Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
22
+ * @method static Carbon disableHumanDiffOption($humanDiffOption)
23
+ * @method static Carbon enableHumanDiffOption($humanDiffOption)
24
+ * @method static mixed executeWithLocale($locale, $func)
25
+ * @method static Carbon fromSerialized($value)
26
+ * @method static array getAvailableLocales()
27
+ * @method static array getDays()
28
+ * @method static int getHumanDiffOptions()
29
+ * @method static array getIsoUnits()
30
+ * @method static Carbon getLastErrors()
31
+ * @method static string getLocale()
32
+ * @method static int getMidDayAt()
33
+ * @method static Carbon getTestNow()
34
+ * @method static \Symfony\Component\Translation\TranslatorInterface getTranslator()
35
+ * @method static int getWeekEndsAt()
36
+ * @method static int getWeekStartsAt()
37
+ * @method static array getWeekendDays()
38
+ * @method static bool hasFormat($date, $format)
39
+ * @method static bool hasMacro($name)
40
+ * @method static bool hasRelativeKeywords($time)
41
+ * @method static bool hasTestNow()
42
+ * @method static Carbon instance($date)
43
+ * @method static bool isImmutable()
44
+ * @method static bool isModifiableUnit($unit)
45
+ * @method static Carbon isMutable()
46
+ * @method static bool isStrictModeEnabled()
47
+ * @method static bool localeHasDiffOneDayWords($locale)
48
+ * @method static bool localeHasDiffSyntax($locale)
49
+ * @method static bool localeHasDiffTwoDayWords($locale)
50
+ * @method static bool localeHasPeriodSyntax($locale)
51
+ * @method static bool localeHasShortUnits($locale)
52
+ * @method static void macro($name, $macro)
53
+ * @method static Carbon|null make($var)
54
+ * @method static Carbon maxValue()
55
+ * @method static Carbon minValue()
56
+ * @method static void mixin($mixin)
57
+ * @method static Carbon now($tz = null)
58
+ * @method static Carbon parse($time = null, $tz = null)
59
+ * @method static string pluralUnit(string $unit)
60
+ * @method static void resetMonthsOverflow()
61
+ * @method static void resetToStringFormat()
62
+ * @method static void resetYearsOverflow()
63
+ * @method static void serializeUsing($callback)
64
+ * @method static Carbon setHumanDiffOptions($humanDiffOptions)
65
+ * @method static bool setLocale($locale)
66
+ * @method static void setMidDayAt($hour)
67
+ * @method static Carbon setTestNow($testNow = null)
68
+ * @method static void setToStringFormat($format)
69
+ * @method static void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator)
70
+ * @method static Carbon setUtf8($utf8)
71
+ * @method static void setWeekEndsAt($day)
72
+ * @method static void setWeekStartsAt($day)
73
+ * @method static void setWeekendDays($days)
74
+ * @method static bool shouldOverflowMonths()
75
+ * @method static bool shouldOverflowYears()
76
+ * @method static string singularUnit(string $unit)
77
+ * @method static Carbon today($tz = null)
78
+ * @method static Carbon tomorrow($tz = null)
79
+ * @method static void useMonthsOverflow($monthsOverflow = true)
80
+ * @method static Carbon useStrictMode($strictModeEnabled = true)
81
+ * @method static void useYearsOverflow($yearsOverflow = true)
82
+ * @method static Carbon yesterday($tz = null)
83
+ */
84
+ class DateFactory
85
+ {
86
+ /**
87
+ * The default class that will be used for all created dates.
88
+ *
89
+ * @var string
90
+ */
91
+ const DEFAULT_CLASS_NAME = Carbon::class;
92
+
93
+ /**
94
+ * The type (class) of dates that should be created.
95
+ *
96
+ * @var string
97
+ */
98
+ protected static $dateClass;
99
+
100
+ /**
101
+ * This callable may be used to intercept date creation.
102
+ *
103
+ * @var callable
104
+ */
105
+ protected static $callable;
106
+
107
+ /**
108
+ * The Carbon factory that should be used when creating dates.
109
+ *
110
+ * @var object
111
+ */
112
+ protected static $factory;
113
+
114
+ /**
115
+ * Use the given handler when generating dates (class name, callable, or factory).
116
+ *
117
+ * @param mixed $handler
118
+ * @return mixed
119
+ *
120
+ * @throws \InvalidArgumentException
121
+ */
122
+ public static function use($handler)
123
+ {
124
+ if (is_callable($handler) && is_object($handler)) {
125
+ return static::useCallable($handler);
126
+ } elseif (is_string($handler)) {
127
+ return static::useClass($handler);
128
+ } elseif ($handler instanceof Factory) {
129
+ return static::useFactory($handler);
130
+ }
131
+
132
+ throw new InvalidArgumentException('Invalid date creation handler. Please provide a class name, callable, or Carbon factory.');
133
+ }
134
+
135
+ /**
136
+ * Use the default date class when generating dates.
137
+ *
138
+ * @return void
139
+ */
140
+ public static function useDefault()
141
+ {
142
+ static::$dateClass = null;
143
+ static::$callable = null;
144
+ static::$factory = null;
145
+ }
146
+
147
+ /**
148
+ * Execute the given callable on each date creation.
149
+ *
150
+ * @param callable $callable
151
+ * @return void
152
+ */
153
+ public static function useCallable(callable $callable)
154
+ {
155
+ static::$callable = $callable;
156
+
157
+ static::$dateClass = null;
158
+ static::$factory = null;
159
+ }
160
+
161
+ /**
162
+ * Use the given date type (class) when generating dates.
163
+ *
164
+ * @param string $dateClass
165
+ * @return void
166
+ */
167
+ public static function useClass($dateClass)
168
+ {
169
+ static::$dateClass = $dateClass;
170
+
171
+ static::$factory = null;
172
+ static::$callable = null;
173
+ }
174
+
175
+ /**
176
+ * Use the given Carbon factory when generating dates.
177
+ *
178
+ * @param object $factory
179
+ * @return void
180
+ */
181
+ public static function useFactory($factory)
182
+ {
183
+ static::$factory = $factory;
184
+
185
+ static::$dateClass = null;
186
+ static::$callable = null;
187
+ }
188
+
189
+ /**
190
+ * Handle dynamic calls to generate dates.
191
+ *
192
+ * @param string $method
193
+ * @param array $parameters
194
+ * @return mixed
195
+ *
196
+ * @throws \RuntimeException
197
+ */
198
+ public function __call($method, $parameters)
199
+ {
200
+ $defaultClassName = static::DEFAULT_CLASS_NAME;
201
+
202
+ // Using callable to generate dates...
203
+ if (static::$callable) {
204
+ return call_user_func(static::$callable, $defaultClassName::$method(...$parameters));
205
+ }
206
+
207
+ // Using Carbon factory to generate dates...
208
+ if (static::$factory) {
209
+ return static::$factory->$method(...$parameters);
210
+ }
211
+
212
+ $dateClass = static::$dateClass ?: $defaultClassName;
213
+
214
+ // Check if date can be created using public class method...
215
+ if (method_exists($dateClass, $method) ||
216
+ method_exists($dateClass, 'hasMacro') && $dateClass::hasMacro($method)) {
217
+ return $dateClass::$method(...$parameters);
218
+ }
219
+
220
+ // If that fails, create the date with the default class...
221
+ $date = $defaultClassName::$method(...$parameters);
222
+
223
+ // If the configured class has an "instance" method, we'll try to pass our date into there...
224
+ if (method_exists($dateClass, 'instance')) {
225
+ return $dateClass::instance($date);
226
+ }
227
+
228
+ // Otherwise, assume the configured class has a DateTime compatible constructor...
229
+ return new $dateClass($date->format('Y-m-d H:i:s.u'), $date->getTimezone());
230
+ }
231
+ }
vendor/illuminate/support/Debug/Dumper.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- namespace Illuminate\Support\Debug;
4
-
5
- use Symfony\Component\VarDumper\Cloner\VarCloner;
6
- use Symfony\Component\VarDumper\Dumper\CliDumper;
7
-
8
- class Dumper
9
- {
10
- /**
11
- * Dump a value with elegance.
12
- *
13
- * @param mixed $value
14
- * @return void
15
- */
16
- public function dump($value)
17
- {
18
- if (class_exists(CliDumper::class)) {
19
- $dumper = 'cli' === PHP_SAPI ? new CliDumper : new HtmlDumper;
20
-
21
- $dumper->dump((new VarCloner)->cloneVar($value));
22
- } else {
23
- var_dump($value);
24
- }
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/illuminate/support/Debug/HtmlDumper.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
-
3
- namespace Illuminate\Support\Debug;
4
-
5
- use Symfony\Component\VarDumper\Dumper\HtmlDumper as SymfonyHtmlDumper;
6
-
7
- class HtmlDumper extends SymfonyHtmlDumper
8
- {
9
- /**
10
- * Colour definitions for output.
11
- *
12
- * @var array
13
- */
14
- protected $styles = [
15
- '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',
16
- 'num' => 'color:#a71d5d',
17
- 'const' => 'color:#795da3',
18
- 'str' => 'color:#df5000',
19
- 'cchr' => 'color:#222',
20
- 'note' => 'color:#a71d5d',
21
- 'ref' => 'color:#a0a0a0',
22
- 'public' => 'color:#795da3',
23
- 'protected' => 'color:#795da3',
24
- 'private' => 'color:#795da3',
25
- 'meta' => 'color:#b729d9',
26
- 'key' => 'color:#df5000',
27
- 'index' => 'color:#a71d5d',
28
- ];
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/illuminate/support/Env.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use Dotenv\Repository\Adapter\PutenvAdapter;
6
+ use Dotenv\Repository\RepositoryBuilder;
7
+ use PhpOption\Option;
8
+
9
+ class Env
10
+ {
11
+ /**
12
+ * Indicates if the putenv adapter is enabled.
13
+ *
14
+ * @var bool
15
+ */
16
+ protected static $putenv = true;
17
+
18
+ /**
19
+ * The environment repository instance.
20
+ *
21
+ * @var \Dotenv\Repository\RepositoryInterface|null
22
+ */
23
+ protected static $repository;
24
+
25
+ /**
26
+ * Enable the putenv adapter.
27
+ *
28
+ * @return void
29
+ */
30
+ public static function enablePutenv()
31
+ {
32
+ static::$putenv = true;
33
+ static::$repository = null;
34
+ }
35
+
36
+ /**
37
+ * Disable the putenv adapter.
38
+ *
39
+ * @return void
40
+ */
41
+ public static function disablePutenv()
42
+ {
43
+ static::$putenv = false;
44
+ static::$repository = null;
45
+ }
46
+
47
+ /**
48
+ * Get the environment repository instance.
49
+ *
50
+ * @return \Dotenv\Repository\RepositoryInterface
51
+ */
52
+ public static function getRepository()
53
+ {
54
+ if (static::$repository === null) {
55
+ $builder = RepositoryBuilder::createWithDefaultAdapters();
56
+
57
+ if (static::$putenv) {
58
+ $builder = $builder->addAdapter(PutenvAdapter::class);
59
+ }
60
+
61
+ static::$repository = $builder->immutable()->make();
62
+ }
63
+
64
+ return static::$repository;
65
+ }
66
+
67
+ /**
68
+ * Gets the value of an environment variable.
69
+ *
70
+ * @param string $key
71
+ * @param mixed $default
72
+ * @return mixed
73
+ */
74
+ public static function get($key, $default = null)
75
+ {
76
+ return Option::fromValue(static::getRepository()->get($key))
77
+ ->map(function ($value) {
78
+ switch (strtolower($value)) {
79
+ case 'true':
80
+ case '(true)':
81
+ return true;
82
+ case 'false':
83
+ case '(false)':
84
+ return false;
85
+ case 'empty':
86
+ case '(empty)':
87
+ return '';
88
+ case 'null':
89
+ case '(null)':
90
+ return;
91
+ }
92
+
93
+ if (preg_match('/\A([\'"])(.*)\1\z/', $value, $matches)) {
94
+ return $matches[2];
95
+ }
96
+
97
+ return $value;
98
+ })
99
+ ->getOrCall(function () use ($default) {
100
+ return value($default);
101
+ });
102
+ }
103
+ }
vendor/illuminate/support/Facades/App.php CHANGED
@@ -3,19 +3,48 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
- * @method static string version()
7
- * @method static string basePath()
8
- * @method static string environment()
 
 
 
 
9
  * @method static bool isDownForMaintenance()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  * @method static void registerConfiguredProviders()
11
- * @method static \Illuminate\Support\ServiceProvider register(\Illuminate\Support\ServiceProvider|string $provider, array $options = [], bool $force = false)
12
  * @method static void registerDeferredProvider(string $provider, string $service = null)
13
- * @method static void boot()
14
- * @method static void booting(mixed $callback)
15
- * @method static void booted(mixed $callback)
16
- * @method static string getCachedServicesPath()
17
  *
18
- * @see \Illuminate\Foundation\Application
19
  */
20
  class App extends Facade
21
  {
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Illuminate\Contracts\Foundation\Application loadEnvironmentFrom(string $file)
7
+ * @method static \Illuminate\Support\ServiceProvider register(\Illuminate\Support\ServiceProvider|string $provider, bool $force = false)
8
+ * @method static \Illuminate\Support\ServiceProvider resolveProvider(string $provider)
9
+ * @method static array getProviders(\Illuminate\Support\ServiceProvider|string $provider)
10
+ * @method static mixed make($abstract, array $parameters = [])
11
+ * @method static bool configurationIsCached()
12
+ * @method static bool hasBeenBootstrapped()
13
  * @method static bool isDownForMaintenance()
14
+ * @method static bool routesAreCached()
15
+ * @method static bool runningInConsole()
16
+ * @method static bool runningUnitTests()
17
+ * @method static bool shouldSkipMiddleware()
18
+ * @method static string basePath(string $path = '')
19
+ * @method static string bootstrapPath(string $path = '')
20
+ * @method static string configPath(string $path = '')
21
+ * @method static string databasePath(string $path = '')
22
+ * @method static string detectEnvironment(callable $callback)
23
+ * @method static string environmentFile()
24
+ * @method static string environmentFilePath()
25
+ * @method static string environmentPath()
26
+ * @method static string getCachedConfigPath()
27
+ * @method static string getCachedPackagesPath()
28
+ * @method static string getCachedRoutesPath()
29
+ * @method static string getCachedServicesPath()
30
+ * @method static string getLocale()
31
+ * @method static string currentLocale()
32
+ * @method static string getNamespace()
33
+ * @method static string resourcePath(string $path = '')
34
+ * @method static string storagePath(string $path = '')
35
+ * @method static string version()
36
+ * @method static string|bool environment(string|array ...$environments)
37
+ * @method static void boot()
38
+ * @method static void booted(callable $callback)
39
+ * @method static void booting(callable $callback)
40
+ * @method static void bootstrapWith(array $bootstrappers)
41
+ * @method static void loadDeferredProviders()
42
  * @method static void registerConfiguredProviders()
 
43
  * @method static void registerDeferredProvider(string $provider, string $service = null)
44
+ * @method static void setLocale(string $locale)
45
+ * @method static void terminate()
 
 
46
  *
47
+ * @see \Illuminate\Contracts\Foundation\Application
48
  */
49
  class App extends Facade
50
  {
vendor/illuminate/support/Facades/Artisan.php CHANGED
@@ -5,11 +5,13 @@ namespace Illuminate\Support\Facades;
5
  use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
6
 
7
  /**
8
- * @method static int handle(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output = null)
9
- * @method static int call(string $command, array $parameters = [])
10
- * @method static int queue(string $command, array $parameters = [])
11
  * @method static array all()
 
 
12
  * @method static string output()
 
13
  *
14
  * @see \Illuminate\Contracts\Console\Kernel
15
  */
5
  use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
6
 
7
  /**
8
+ * @method static \Illuminate\Foundation\Bus\PendingDispatch queue(string $command, array $parameters = [])
9
+ * @method static \Illuminate\Foundation\Console\ClosureCommand command(string $command, callable $callback)
 
10
  * @method static array all()
11
+ * @method static int call(string $command, array $parameters = [], \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer = null)
12
+ * @method static int handle(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface|null $output = null)
13
  * @method static string output()
14
+ * @method static void terminate(\Symfony\Component\Console\Input\InputInterface $input, int $status)
15
  *
16
  * @see \Illuminate\Contracts\Console\Kernel
17
  */
vendor/illuminate/support/Facades/Auth.php CHANGED
@@ -2,22 +2,31 @@
2
 
3
  namespace Illuminate\Support\Facades;
4
 
 
 
 
5
  /**
6
- * @method static mixed guard(string|null $name = null)
7
- * @method static void shouldUse(string $name);
8
- * @method static bool check()
9
- * @method static bool guest()
10
  * @method static \Illuminate\Contracts\Auth\Authenticatable|null user()
11
- * @method static int|null id()
12
- * @method static bool validate(array $credentials = [])
13
- * @method static void setUser(\Illuminate\Contracts\Auth\Authenticatable $user)
14
  * @method static bool attempt(array $credentials = [], bool $remember = false)
 
 
15
  * @method static bool once(array $credentials = [])
16
- * @method static void login(\Illuminate\Contracts\Auth\Authenticatable $user, bool $remember = false)
17
- * @method static \Illuminate\Contracts\Auth\Authenticatable loginUsingId(mixed $id, bool $remember = false)
18
  * @method static bool onceUsingId(mixed $id)
 
19
  * @method static bool viaRemember()
 
 
 
20
  * @method static void logout()
 
 
 
21
  *
22
  * @see \Illuminate\Auth\AuthManager
23
  * @see \Illuminate\Contracts\Auth\Factory
@@ -39,10 +48,15 @@ class Auth extends Facade
39
  /**
40
  * Register the typical authentication routes for an application.
41
  *
 
42
  * @return void
43
  */
44
- public static function routes()
45
  {
46
- static::$app->make('router')->auth();
 
 
 
 
47
  }
48
  }
2
 
3
  namespace Illuminate\Support\Facades;
4
 
5
+ use Laravel\Ui\UiServiceProvider;
6
+ use RuntimeException;
7
+
8
  /**
9
+ * @method static \Illuminate\Auth\AuthManager extend(string $driver, \Closure $callback)
10
+ * @method static \Illuminate\Auth\AuthManager provider(string $name, \Closure $callback)
11
+ * @method static \Illuminate\Contracts\Auth\Authenticatable loginUsingId(mixed $id, bool $remember = false)
 
12
  * @method static \Illuminate\Contracts\Auth\Authenticatable|null user()
13
+ * @method static \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard guard(string|null $name = null)
14
+ * @method static \Illuminate\Contracts\Auth\UserProvider|null createUserProvider(string $provider = null)
15
+ * @method static \Symfony\Component\HttpFoundation\Response|null onceBasic(string $field = 'email',array $extraConditions = [])
16
  * @method static bool attempt(array $credentials = [], bool $remember = false)
17
+ * @method static bool check()
18
+ * @method static bool guest()
19
  * @method static bool once(array $credentials = [])
 
 
20
  * @method static bool onceUsingId(mixed $id)
21
+ * @method static bool validate(array $credentials = [])
22
  * @method static bool viaRemember()
23
+ * @method static bool|null logoutOtherDevices(string $password, string $attribute = 'password')
24
+ * @method static int|string|null id()
25
+ * @method static void login(\Illuminate\Contracts\Auth\Authenticatable $user, bool $remember = false)
26
  * @method static void logout()
27
+ * @method static void logoutCurrentDevice()
28
+ * @method static void setUser(\Illuminate\Contracts\Auth\Authenticatable $user)
29
+ * @method static void shouldUse(string $name);
30
  *
31
  * @see \Illuminate\Auth\AuthManager
32
  * @see \Illuminate\Contracts\Auth\Factory
48
  /**
49
  * Register the typical authentication routes for an application.
50
  *
51
+ * @param array $options
52
  * @return void
53
  */
54
+ public static function routes(array $options = [])
55
  {
56
+ if (! static::$app->providerIsLoaded(UiServiceProvider::class)) {
57
+ throw new RuntimeException('In order to use the Auth::routes() method, please install the laravel/ui package.');
58
+ }
59
+
60
+ static::$app->make('router')->auth($options);
61
  }
62
  }
vendor/illuminate/support/Facades/Blade.php CHANGED
@@ -3,6 +3,30 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\View\Compilers\BladeCompiler
7
  */
8
  class Blade extends Facade
@@ -14,6 +38,6 @@ class Blade extends Facade
14
  */
15
  protected static function getFacadeAccessor()
16
  {
17
- return static::$app['view']->getEngineResolver()->resolve('blade')->getCompiler();
18
  }
19
  }
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static array getClassComponentAliases()
7
+ * @method static array getCustomDirectives()
8
+ * @method static array getExtensions()
9
+ * @method static bool check(string $name, array ...$parameters)
10
+ * @method static string compileString(string $value)
11
+ * @method static string getPath()
12
+ * @method static string stripParentheses(string $expression)
13
+ * @method static void aliasComponent(string $path, string|null $alias = null)
14
+ * @method static void aliasInclude(string $path, string|null $alias = null)
15
+ * @method static void compile(string|null $path = null)
16
+ * @method static void component(string $class, string|null $alias = null, string $prefix = '')
17
+ * @method static void components(array $components, string $prefix = '')
18
+ * @method static void componentNamespace(string $namespace, string $prefix)
19
+ * @method static void directive(string $name, callable $handler)
20
+ * @method static void extend(callable $compiler)
21
+ * @method static void if(string $name, callable $callback)
22
+ * @method static void include(string $path, string|null $alias = null)
23
+ * @method static void precompiler(callable $precompiler)
24
+ * @method static void setEchoFormat(string $format)
25
+ * @method static void setPath(string $path)
26
+ * @method static void withDoubleEncoding()
27
+ * @method static void withoutComponentTags()
28
+ * @method static void withoutDoubleEncoding()
29
+ *
30
  * @see \Illuminate\View\Compilers\BladeCompiler
31
  */
32
  class Blade extends Facade
38
  */
39
  protected static function getFacadeAccessor()
40
  {
41
+ return 'blade.compiler';
42
  }
43
  }
vendor/illuminate/support/Facades/Broadcast.php CHANGED
@@ -5,6 +5,12 @@ namespace Illuminate\Support\Facades;
5
  use Illuminate\Contracts\Broadcasting\Factory as BroadcastingFactoryContract;
6
 
7
  /**
 
 
 
 
 
 
8
  * @see \Illuminate\Contracts\Broadcasting\Factory
9
  */
10
  class Broadcast extends Facade
5
  use Illuminate\Contracts\Broadcasting\Factory as BroadcastingFactoryContract;
6
 
7
  /**
8
+ * @method static \Illuminate\Broadcasting\Broadcasters\Broadcaster channel(string $channel, callable|string $callback, array $options = [])
9
+ * @method static mixed auth(\Illuminate\Http\Request $request)
10
+ * @method static void connection($name = null);
11
+ * @method static void routes(array $attributes = null)
12
+ * @method static \Illuminate\Broadcasting\BroadcastManager socket($request = null)
13
+ *
14
  * @see \Illuminate\Contracts\Broadcasting\Factory
15
  */
16
  class Broadcast extends Facade
vendor/illuminate/support/Facades/Bus.php CHANGED
@@ -2,10 +2,29 @@
2
 
3
  namespace Illuminate\Support\Facades;
4
 
5
- use Illuminate\Support\Testing\Fakes\BusFake;
6
  use Illuminate\Contracts\Bus\Dispatcher as BusDispatcherContract;
 
 
7
 
8
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  * @see \Illuminate\Contracts\Bus\Dispatcher
10
  */
11
  class Bus extends Facade
@@ -13,11 +32,28 @@ class Bus extends Facade
13
  /**
14
  * Replace the bound instance with a fake.
15
  *
16
- * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  */
18
- public static function fake()
19
  {
20
- static::swap(new BusFake);
 
 
 
21
  }
22
 
23
  /**
2
 
3
  namespace Illuminate\Support\Facades;
4
 
 
5
  use Illuminate\Contracts\Bus\Dispatcher as BusDispatcherContract;
6
+ use Illuminate\Foundation\Bus\PendingChain;
7
+ use Illuminate\Support\Testing\Fakes\BusFake;
8
 
9
  /**
10
+ * @method static \Illuminate\Bus\Batch|null findBatch(string $batchId)
11
+ * @method static \Illuminate\Bus\PendingBatch batch(array|mixed $jobs)
12
+ * @method static \Illuminate\Contracts\Bus\Dispatcher map(array $map)
13
+ * @method static \Illuminate\Contracts\Bus\Dispatcher pipeThrough(array $pipes)
14
+ * @method static \Illuminate\Foundation\Bus\PendingChain chain(array $jobs)
15
+ * @method static bool hasCommandHandler($command)
16
+ * @method static bool|mixed getCommandHandler($command)
17
+ * @method static mixed dispatch($command)
18
+ * @method static mixed dispatchNow($command, $handler = null)
19
+ * @method static mixed dispatchSync($command, $handler = null)
20
+ * @method static void assertDispatched(string|\Closure $command, callable|int $callback = null)
21
+ * @method static void assertDispatchedTimes(string $command, int $times = 1)
22
+ * @method static void assertNotDispatched(string|\Closure $command, callable|int $callback = null)
23
+ * @method static void assertDispatchedAfterResponse(string|\Closure $command, callable|int $callback = null)
24
+ * @method static void assertDispatchedAfterResponseTimes(string $command, int $times = 1)
25
+ * @method static void assertNotDispatchedAfterResponse(string|\Closure $command, callable $callback = null)
26
+ * @method static void assertBatched(callable $callback)
27
+ *
28
  * @see \Illuminate\Contracts\Bus\Dispatcher
29
  */
30
  class Bus extends Facade
32
  /**
33
  * Replace the bound instance with a fake.
34
  *
35
+ * @param array|string $jobsToFake
36
+ * @return \Illuminate\Support\Testing\Fakes\BusFake
37
+ */
38
+ public static function fake($jobsToFake = [])
39
+ {
40
+ static::swap($fake = new BusFake(static::getFacadeRoot(), $jobsToFake));
41
+
42
+ return $fake;
43
+ }
44
+
45
+ /**
46
+ * Dispatch the given chain of jobs.
47
+ *
48
+ * @param array|mixed $jobs
49
+ * @return \Illuminate\Foundation\Bus\PendingDispatch
50
  */
51
+ public static function dispatchChain($jobs)
52
  {
53
+ $jobs = is_array($jobs) ? $jobs : func_get_args();
54
+
55
+ return (new PendingChain(array_shift($jobs), $jobs))
56
+ ->dispatch();
57
  }
58
 
59
  /**
vendor/illuminate/support/Facades/Cache.php CHANGED
@@ -3,6 +3,26 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Cache\CacheManager
7
  * @see \Illuminate\Cache\Repository
8
  */
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Illuminate\Cache\TaggedCache tags(array|mixed $names)
7
+ * @method static \Illuminate\Contracts\Cache\Lock lock(string $name, int $seconds = 0, mixed $owner = null)
8
+ * @method static \Illuminate\Contracts\Cache\Lock restoreLock(string $name, string $owner)
9
+ * @method static \Illuminate\Contracts\Cache\Repository store(string|null $name = null)
10
+ * @method static \Illuminate\Contracts\Cache\Store getStore()
11
+ * @method static bool add(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null)
12
+ * @method static bool flush()
13
+ * @method static bool forever(string $key, $value)
14
+ * @method static bool forget(string $key)
15
+ * @method static bool has(string $key)
16
+ * @method static bool missing(string $key)
17
+ * @method static bool put(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null)
18
+ * @method static int|bool decrement(string $key, $value = 1)
19
+ * @method static int|bool increment(string $key, $value = 1)
20
+ * @method static mixed get(string $key, mixed $default = null)
21
+ * @method static mixed pull(string $key, mixed $default = null)
22
+ * @method static mixed remember(string $key, \DateTimeInterface|\DateInterval|int $ttl, \Closure $callback)
23
+ * @method static mixed rememberForever(string $key, \Closure $callback)
24
+ * @method static mixed sear(string $key, \Closure $callback)
25
+ *
26
  * @see \Illuminate\Cache\CacheManager
27
  * @see \Illuminate\Cache\Repository
28
  */
vendor/illuminate/support/Facades/Config.php CHANGED
@@ -3,6 +3,13 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
6
  * @see \Illuminate\Config\Repository
7
  */
8
  class Config extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static array all()
7
+ * @method static bool has($key)
8
+ * @method static mixed get($key, $default = null)
9
+ * @method static void prepend($key, $value)
10
+ * @method static void push($key, $value)
11
+ * @method static void set($key, $value = null)
12
+ *
13
  * @see \Illuminate\Config\Repository
14
  */
15
  class Config extends Facade
vendor/illuminate/support/Facades/Cookie.php CHANGED
@@ -3,6 +3,10 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
6
  * @see \Illuminate\Cookie\CookieJar
7
  */
8
  class Cookie extends Facade
@@ -21,9 +25,9 @@ class Cookie extends Facade
21
  /**
22
  * Retrieve a cookie from the request.
23
  *
24
- * @param string $key
25
- * @param mixed $default
26
- * @return string
27
  */
28
  public static function get($key = null, $default = null)
29
  {
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static array getQueuedCookies()
7
+ * @method static unqueue($name)
8
+ * @method static void queue(...$parameters)
9
+ *
10
  * @see \Illuminate\Cookie\CookieJar
11
  */
12
  class Cookie extends Facade
25
  /**
26
  * Retrieve a cookie from the request.
27
  *
28
+ * @param string|null $key
29
+ * @param mixed $default
30
+ * @return string|array|null
31
  */
32
  public static function get($key = null, $default = null)
33
  {
vendor/illuminate/support/Facades/Crypt.php CHANGED
@@ -3,6 +3,14 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Encryption\Encrypter
7
  */
8
  class Crypt extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static bool supported(string $key, string $cipher)
7
+ * @method static mixed decrypt(string $payload, bool $unserialize = true)
8
+ * @method static string decryptString(string $payload)
9
+ * @method static string encrypt(mixed $value, bool $serialize = true)
10
+ * @method static string encryptString(string $value)
11
+ * @method static string generateKey(string $cipher)
12
+ * @method static string getKey()
13
+ *
14
  * @see \Illuminate\Encryption\Encrypter
15
  */
16
  class Crypt extends Facade
vendor/illuminate/support/Facades/DB.php CHANGED
@@ -3,6 +3,35 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Database\DatabaseManager
7
  * @see \Illuminate\Database\Connection
8
  */
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Doctrine\DBAL\Driver\PDOConnection getPdo()
7
+ * @method static \Illuminate\Database\ConnectionInterface connection(string $name = null)
8
+ * @method static \Illuminate\Database\Query\Builder table(string $table, string $as = null)
9
+ * @method static \Illuminate\Database\Query\Expression raw($value)
10
+ * @method static array getQueryLog()
11
+ * @method static array prepareBindings(array $bindings)
12
+ * @method static array pretend(\Closure $callback)
13
+ * @method static array select(string $query, array $bindings = [], bool $useReadPdo = true)
14
+ * @method static bool insert(string $query, array $bindings = [])
15
+ * @method static bool logging()
16
+ * @method static bool statement(string $query, array $bindings = [])
17
+ * @method static bool unprepared(string $query)
18
+ * @method static int affectingStatement(string $query, array $bindings = [])
19
+ * @method static int delete(string $query, array $bindings = [])
20
+ * @method static int transactionLevel()
21
+ * @method static int update(string $query, array $bindings = [])
22
+ * @method static mixed selectOne(string $query, array $bindings = [], bool $useReadPdo = true)
23
+ * @method static mixed transaction(\Closure $callback, int $attempts = 1)
24
+ * @method static string getDefaultConnection()
25
+ * @method static void afterCommit(\Closure $callback)
26
+ * @method static void beginTransaction()
27
+ * @method static void commit()
28
+ * @method static void enableQueryLog()
29
+ * @method static void disableQueryLog()
30
+ * @method static void flushQueryLog()
31
+ * @method static void listen(\Closure $callback)
32
+ * @method static void rollBack(int $toLevel = null)
33
+ * @method static void setDefaultConnection(string $name)
34
+ *
35
  * @see \Illuminate\Database\DatabaseManager
36
  * @see \Illuminate\Database\Connection
37
  */
vendor/illuminate/support/Facades/Date.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Facades;
4
+
5
+ use Illuminate\Support\DateFactory;
6
+
7
+ /**
8
+ * @see https://carbon.nesbot.com/docs/
9
+ * @see https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Factory.php
10
+ *
11
+ * @method static \Illuminate\Support\Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null)
12
+ * @method static \Illuminate\Support\Carbon createFromDate($year = null, $month = null, $day = null, $tz = null)
13
+ * @method static \Illuminate\Support\Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null)
14
+ * @method static \Illuminate\Support\Carbon createFromTimeString($time, $tz = null)
15
+ * @method static \Illuminate\Support\Carbon createFromTimestamp($timestamp, $tz = null)
16
+ * @method static \Illuminate\Support\Carbon createFromTimestampMs($timestamp, $tz = null)
17
+ * @method static \Illuminate\Support\Carbon createFromTimestampUTC($timestamp)
18
+ * @method static \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null)
19
+ * @method static \Illuminate\Support\Carbon disableHumanDiffOption($humanDiffOption)
20
+ * @method static \Illuminate\Support\Carbon enableHumanDiffOption($humanDiffOption)
21
+ * @method static \Illuminate\Support\Carbon fromSerialized($value)
22
+ * @method static \Illuminate\Support\Carbon getLastErrors()
23
+ * @method static \Illuminate\Support\Carbon getTestNow()
24
+ * @method static \Illuminate\Support\Carbon instance($date)
25
+ * @method static \Illuminate\Support\Carbon isMutable()
26
+ * @method static \Illuminate\Support\Carbon maxValue()
27
+ * @method static \Illuminate\Support\Carbon minValue()
28
+ * @method static \Illuminate\Support\Carbon now($tz = null)
29
+ * @method static \Illuminate\Support\Carbon parse($time = null, $tz = null)
30
+ * @method static \Illuminate\Support\Carbon setHumanDiffOptions($humanDiffOptions)
31
+ * @method static \Illuminate\Support\Carbon setTestNow($testNow = null)
32
+ * @method static \Illuminate\Support\Carbon setUtf8($utf8)
33
+ * @method static \Illuminate\Support\Carbon today($tz = null)
34
+ * @method static \Illuminate\Support\Carbon tomorrow($tz = null)
35
+ * @method static \Illuminate\Support\Carbon useStrictMode($strictModeEnabled = true)
36
+ * @method static \Illuminate\Support\Carbon yesterday($tz = null)
37
+ * @method static \Illuminate\Support\Carbon|false createFromFormat($format, $time, $tz = null)
38
+ * @method static \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
39
+ * @method static \Illuminate\Support\Carbon|null make($var)
40
+ * @method static \Symfony\Component\Translation\TranslatorInterface getTranslator()
41
+ * @method static array getAvailableLocales()
42
+ * @method static array getDays()
43
+ * @method static array getIsoUnits()
44
+ * @method static array getWeekendDays()
45
+ * @method static bool hasFormat($date, $format)
46
+ * @method static bool hasMacro($name)
47
+ * @method static bool hasRelativeKeywords($time)
48
+ * @method static bool hasTestNow()
49
+ * @method static bool isImmutable()
50
+ * @method static bool isModifiableUnit($unit)
51
+ * @method static bool isStrictModeEnabled()
52
+ * @method static bool localeHasDiffOneDayWords($locale)
53
+ * @method static bool localeHasDiffSyntax($locale)
54
+ * @method static bool localeHasDiffTwoDayWords($locale)
55
+ * @method static bool localeHasPeriodSyntax($locale)
56
+ * @method static bool localeHasShortUnits($locale)
57
+ * @method static bool setLocale($locale)
58
+ * @method static bool shouldOverflowMonths()
59
+ * @method static bool shouldOverflowYears()
60
+ * @method static int getHumanDiffOptions()
61
+ * @method static int getMidDayAt()
62
+ * @method static int getWeekEndsAt()
63
+ * @method static int getWeekStartsAt()
64
+ * @method static mixed executeWithLocale($locale, $func)
65
+ * @method static mixed use(mixed $handler)
66
+ * @method static string getLocale()
67
+ * @method static string pluralUnit(string $unit)
68
+ * @method static string singularUnit(string $unit)
69
+ * @method static void macro($name, $macro)
70
+ * @method static void mixin($mixin)
71
+ * @method static void resetMonthsOverflow()
72
+ * @method static void resetToStringFormat()
73
+ * @method static void resetYearsOverflow()
74
+ * @method static void serializeUsing($callback)
75
+ * @method static void setMidDayAt($hour)
76
+ * @method static void setToStringFormat($format)
77
+ * @method static void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator)
78
+ * @method static void setWeekEndsAt($day)
79
+ * @method static void setWeekStartsAt($day)
80
+ * @method static void setWeekendDays($days)
81
+ * @method static void useCallable(callable $callable)
82
+ * @method static void useClass(string $class)
83
+ * @method static void useDefault()
84
+ * @method static void useFactory(object $factory)
85
+ * @method static void useMonthsOverflow($monthsOverflow = true)
86
+ * @method static void useYearsOverflow($yearsOverflow = true)
87
+ */
88
+ class Date extends Facade
89
+ {
90
+ const DEFAULT_FACADE = DateFactory::class;
91
+
92
+ /**
93
+ * Get the registered name of the component.
94
+ *
95
+ * @return string
96
+ *
97
+ * @throws \RuntimeException
98
+ */
99
+ protected static function getFacadeAccessor()
100
+ {
101
+ return 'date';
102
+ }
103
+
104
+ /**
105
+ * Resolve the facade root instance from the container.
106
+ *
107
+ * @param string $name
108
+ * @return mixed
109
+ */
110
+ protected static function resolveFacadeInstance($name)
111
+ {
112
+ if (! isset(static::$resolvedInstance[$name]) && ! isset(static::$app, static::$app[$name])) {
113
+ $class = static::DEFAULT_FACADE;
114
+
115
+ static::swap(new $class);
116
+ }
117
+
118
+ return parent::resolveFacadeInstance($name);
119
+ }
120
+ }
vendor/illuminate/support/Facades/Event.php CHANGED
@@ -6,6 +6,23 @@ use Illuminate\Database\Eloquent\Model;
6
  use Illuminate\Support\Testing\Fakes\EventFake;
7
 
8
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  * @see \Illuminate\Events\Dispatcher
10
  */
11
  class Event extends Facade
@@ -13,13 +30,38 @@ class Event extends Facade
13
  /**
14
  * Replace the bound instance with a fake.
15
  *
16
- * @return void
 
17
  */
18
- public static function fake()
19
  {
20
- static::swap($fake = new EventFake);
21
 
22
  Model::setEventDispatcher($fake);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
 
25
  /**
6
  use Illuminate\Support\Testing\Fakes\EventFake;
7
 
8
  /**
9
+ * @method static \Closure createClassListener(string $listener, bool $wildcard = false)
10
+ * @method static \Closure makeListener(\Closure|string $listener, bool $wildcard = false)
11
+ * @method static \Illuminate\Events\Dispatcher setQueueResolver(callable $resolver)
12
+ * @method static array getListeners(string $eventName)
13
+ * @method static array|null dispatch(string|object $event, mixed $payload = [], bool $halt = false)
14
+ * @method static array|null until(string|object $event, mixed $payload = [])
15
+ * @method static bool hasListeners(string $eventName)
16
+ * @method static void assertDispatched(string|\Closure $event, callable|int $callback = null)
17
+ * @method static void assertDispatchedTimes(string $event, int $times = 1)
18
+ * @method static void assertNotDispatched(string|\Closure $event, callable|int $callback = null)
19
+ * @method static void flush(string $event)
20
+ * @method static void forget(string $event)
21
+ * @method static void forgetPushed()
22
+ * @method static void listen(\Closure|string|array $events, \Closure|string $listener = null)
23
+ * @method static void push(string $event, array $payload = [])
24
+ * @method static void subscribe(object|string $subscriber)
25
+ *
26
  * @see \Illuminate\Events\Dispatcher
27
  */
28
  class Event extends Facade
30
  /**
31
  * Replace the bound instance with a fake.
32
  *
33
+ * @param array|string $eventsToFake
34
+ * @return \Illuminate\Support\Testing\Fakes\EventFake
35
  */
36
+ public static function fake($eventsToFake = [])
37
  {
38
+ static::swap($fake = new EventFake(static::getFacadeRoot(), $eventsToFake));
39
 
40
  Model::setEventDispatcher($fake);
41
+ Cache::refreshEventDispatcher();
42
+
43
+ return $fake;
44
+ }
45
+
46
+ /**
47
+ * Replace the bound instance with a fake during the given callable's execution.
48
+ *
49
+ * @param callable $callable
50
+ * @param array $eventsToFake
51
+ * @return callable
52
+ */
53
+ public static function fakeFor(callable $callable, array $eventsToFake = [])
54
+ {
55
+ $originalDispatcher = static::getFacadeRoot();
56
+
57
+ static::fake($eventsToFake);
58
+
59
+ return tap($callable(), function () use ($originalDispatcher) {
60
+ static::swap($originalDispatcher);
61
+
62
+ Model::setEventDispatcher($originalDispatcher);
63
+ Cache::refreshEventDispatcher();
64
+ });
65
  }
66
 
67
  /**
vendor/illuminate/support/Facades/Facade.php CHANGED
@@ -2,9 +2,10 @@
2
 
3
  namespace Illuminate\Support\Facades;
4
 
 
5
  use Mockery;
6
- use RuntimeException;
7
  use Mockery\MockInterface;
 
8
 
9
  abstract class Facade
10
  {
@@ -23,19 +24,56 @@ abstract class Facade
23
  protected static $resolvedInstance;
24
 
25
  /**
26
- * Convert the facade into a Mockery spy.
27
  *
 
28
  * @return void
29
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  public static function spy()
31
  {
32
  if (! static::isMock()) {
33
  $class = static::getMockableClass();
34
 
35
- static::swap($class ? Mockery::spy($class) : Mockery::spy());
 
 
36
  }
37
  }
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  /**
40
  * Initiate a mock expectation on the facade.
41
  *
@@ -55,7 +93,7 @@ abstract class Facade
55
  /**
56
  * Create a fresh mock instance for the given class.
57
  *
58
- * @return \Mockery\Expectation
59
  */
60
  protected static function createFreshMockInstance()
61
  {
@@ -143,7 +181,7 @@ abstract class Facade
143
  /**
144
  * Resolve the facade root instance from the container.
145
  *
146
- * @param string|object $name
147
  * @return mixed
148
  */
149
  protected static function resolveFacadeInstance($name)
@@ -156,7 +194,9 @@ abstract class Facade
156
  return static::$resolvedInstance[$name];
157
  }
158
 
159
- return static::$resolvedInstance[$name] = static::$app[$name];
 
 
160
  }
161
 
162
  /**
@@ -205,7 +245,7 @@ abstract class Facade
205
  * Handle dynamic, static calls to the object.
206
  *
207
  * @param string $method
208
- * @param array $args
209
  * @return mixed
210
  *
211
  * @throws \RuntimeException
2
 
3
  namespace Illuminate\Support\Facades;
4
 
5
+ use Closure;
6
  use Mockery;
 
7
  use Mockery\MockInterface;
8
+ use RuntimeException;
9
 
10
  abstract class Facade
11
  {
24
  protected static $resolvedInstance;
25
 
26
  /**
27
+ * Run a Closure when the facade has been resolved.
28
  *
29
+ * @param \Closure $callback
30
  * @return void
31
  */
32
+ public static function resolved(Closure $callback)
33
+ {
34
+ $accessor = static::getFacadeAccessor();
35
+
36
+ if (static::$app->resolved($accessor) === true) {
37
+ $callback(static::getFacadeRoot());
38
+ }
39
+
40
+ static::$app->afterResolving($accessor, function ($service) use ($callback) {
41
+ $callback($service);
42
+ });
43
+ }
44
+
45
+ /**
46
+ * Convert the facade into a Mockery spy.
47
+ *
48
+ * @return \Mockery\MockInterface
49
+ */
50
  public static function spy()
51
  {
52
  if (! static::isMock()) {
53
  $class = static::getMockableClass();
54
 
55
+ return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) {
56
+ static::swap($spy);
57
+ });
58
  }
59
  }
60
 
61
+ /**
62
+ * Initiate a partial mock on the facade.
63
+ *
64
+ * @return \Mockery\MockInterface
65
+ */
66
+ public static function partialMock()
67
+ {
68
+ $name = static::getFacadeAccessor();
69
+
70
+ $mock = static::isMock()
71
+ ? static::$resolvedInstance[$name]
72
+ : static::createFreshMockInstance();
73
+
74
+ return $mock->makePartial();
75
+ }
76
+
77
  /**
78
  * Initiate a mock expectation on the facade.
79
  *
93
  /**
94
  * Create a fresh mock instance for the given class.
95
  *
96
+ * @return \Mockery\MockInterface
97
  */
98
  protected static function createFreshMockInstance()
99
  {
181
  /**
182
  * Resolve the facade root instance from the container.
183
  *
184
+ * @param object|string $name
185
  * @return mixed
186
  */
187
  protected static function resolveFacadeInstance($name)
194
  return static::$resolvedInstance[$name];
195
  }
196
 
197
+ if (static::$app) {
198
+ return static::$resolvedInstance[$name] = static::$app[$name];
199
+ }
200
  }
201
 
202
  /**
245
  * Handle dynamic, static calls to the object.
246
  *
247
  * @param string $method
248
+ * @param array $args
249
  * @return mixed
250
  *
251
  * @throws \RuntimeException
vendor/illuminate/support/Facades/File.php CHANGED
@@ -3,6 +3,47 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Filesystem\Filesystem
7
  */
8
  class File extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Symfony\Component\Finder\SplFileInfo[] allFiles(string $directory, bool $hidden = false)
7
+ * @method static \Symfony\Component\Finder\SplFileInfo[] files(string $directory, bool $hidden = false)
8
+ * @method static array directories(string $directory)
9
+ * @method static array glob(string $pattern, int $flags = 0)
10
+ * @method static bool cleanDirectory(string $directory)
11
+ * @method static bool copy(string $path, string $target)
12
+ * @method static bool copyDirectory(string $directory, string $destination, int|null $options = null)
13
+ * @method static bool delete(string|array $paths)
14
+ * @method static bool deleteDirectories(string $directory)
15
+ * @method static bool deleteDirectory(string $directory, bool $preserve = false)
16
+ * @method static bool exists(string $path)
17
+ * @method static bool isDirectory(string $directory)
18
+ * @method static bool isFile(string $file)
19
+ * @method static bool isReadable(string $path)
20
+ * @method static bool isWritable(string $path)
21
+ * @method static bool makeDirectory(string $path, int $mode = 0755, bool $recursive = false, bool $force = false)
22
+ * @method static bool move(string $path, string $target)
23
+ * @method static bool moveDirectory(string $from, string $to, bool $overwrite = false)
24
+ * @method static int append(string $path, string $data)
25
+ * @method static int lastModified(string $path)
26
+ * @method static int prepend(string $path, string $data)
27
+ * @method static int size(string $path)
28
+ * @method static int|bool put(string $path, string $contents, bool $lock = false)
29
+ * @method static mixed chmod(string $path, int|null $mode = null)
30
+ * @method static mixed getRequire(string $path)
31
+ * @method static mixed requireOnce(string $file)
32
+ * @method static string basename(string $path)
33
+ * @method static string dirname(string $path)
34
+ * @method static string extension(string $path)
35
+ * @method static string get(string $path, bool $lock = false)
36
+ * @method static string hash(string $path)
37
+ * @method static string name(string $path)
38
+ * @method static string sharedGet(string $path)
39
+ * @method static string type(string $path)
40
+ * @method static string|false mimeType(string $path)
41
+ * @method static void ensureDirectoryExists(string $path, int $mode = 0755, bool $recursive = true)
42
+ * @method static void link(string $target, string $link)
43
+ * @method static \Illuminate\Support\LazyCollection lines(string $path)
44
+ * @method static void relativeLink(string $target, string $link)
45
+ * @method static void replace(string $path, string $content)
46
+ *
47
  * @see \Illuminate\Filesystem\Filesystem
48
  */
49
  class File extends Facade
vendor/illuminate/support/Facades/Gate.php CHANGED
@@ -5,6 +5,23 @@ namespace Illuminate\Support\Facades;
5
  use Illuminate\Contracts\Auth\Access\Gate as GateContract;
6
 
7
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  * @see \Illuminate\Contracts\Auth\Access\Gate
9
  */
10
  class Gate extends Facade
5
  use Illuminate\Contracts\Auth\Access\Gate as GateContract;
6
 
7
  /**
8
+ * @method static \Illuminate\Auth\Access\Gate guessPolicyNamesUsing(callable $callback)
9
+ * @method static \Illuminate\Auth\Access\Response authorize(string $ability, array|mixed $arguments = [])
10
+ * @method static \Illuminate\Auth\Access\Response inspect(string $ability, array|mixed $arguments = [])
11
+ * @method static \Illuminate\Contracts\Auth\Access\Gate after(callable $callback)
12
+ * @method static \Illuminate\Contracts\Auth\Access\Gate before(callable $callback)
13
+ * @method static \Illuminate\Contracts\Auth\Access\Gate define(string $ability, callable|string $callback)
14
+ * @method static \Illuminate\Contracts\Auth\Access\Gate forUser(\Illuminate\Contracts\Auth\Authenticatable|mixed $user)
15
+ * @method static \Illuminate\Contracts\Auth\Access\Gate policy(string $class, string $policy)
16
+ * @method static array abilities()
17
+ * @method static bool allows(string $ability, array|mixed $arguments = [])
18
+ * @method static bool any(iterable|string $abilities, array|mixed $arguments = [])
19
+ * @method static bool check(iterable|string $abilities, array|mixed $arguments = [])
20
+ * @method static bool denies(string $ability, array|mixed $arguments = [])
21
+ * @method static bool has(string $ability)
22
+ * @method static mixed getPolicyFor(object|string $class)
23
+ * @method static mixed raw(string $ability, array|mixed $arguments = [])
24
+ *
25
  * @see \Illuminate\Contracts\Auth\Access\Gate
26
  */
27
  class Gate extends Facade
vendor/illuminate/support/Facades/Hash.php CHANGED
@@ -3,7 +3,12 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
- * @see \Illuminate\Hashing\BcryptHasher
 
 
 
 
 
7
  */
8
  class Hash extends Facade
9
  {
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static array info(string $hashedValue)
7
+ * @method static bool check(string $value, string $hashedValue, array $options = [])
8
+ * @method static bool needsRehash(string $hashedValue, array $options = [])
9
+ * @method static string make(string $value, array $options = [])
10
+ *
11
+ * @see \Illuminate\Hashing\HashManager
12
  */
13
  class Hash extends Facade
14
  {
vendor/illuminate/support/Facades/Http.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Facades;
4
+
5
+ use Illuminate\Http\Client\Factory;
6
+
7
+ /**
8
+ * @method static \GuzzleHttp\Promise\PromiseInterface response($body = null, $status = 200, $headers = [])
9
+ * @method static \Illuminate\Http\Client\Factory fake($callback = null)
10
+ * @method static \Illuminate\Http\Client\PendingRequest accept(string $contentType)
11
+ * @method static \Illuminate\Http\Client\PendingRequest acceptJson()
12
+ * @method static \Illuminate\Http\Client\PendingRequest asForm()
13
+ * @method static \Illuminate\Http\Client\PendingRequest asJson()
14
+ * @method static \Illuminate\Http\Client\PendingRequest asMultipart()
15
+ * @method static \Illuminate\Http\Client\PendingRequest attach(string $name, string $contents, string|null $filename = null, array $headers = [])
16
+ * @method static \Illuminate\Http\Client\PendingRequest baseUrl(string $url)
17
+ * @method static \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback)
18
+ * @method static \Illuminate\Http\Client\PendingRequest bodyFormat(string $format)
19
+ * @method static \Illuminate\Http\Client\PendingRequest contentType(string $contentType)
20
+ * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0)
21
+ * @method static \Illuminate\Http\Client\PendingRequest sink($to)
22
+ * @method static \Illuminate\Http\Client\PendingRequest stub(callable $callback)
23
+ * @method static \Illuminate\Http\Client\PendingRequest timeout(int $seconds)
24
+ * @method static \Illuminate\Http\Client\PendingRequest withBasicAuth(string $username, string $password)
25
+ * @method static \Illuminate\Http\Client\PendingRequest withBody(resource|string $content, string $contentType)
26
+ * @method static \Illuminate\Http\Client\PendingRequest withCookies(array $cookies, string $domain)
27
+ * @method static \Illuminate\Http\Client\PendingRequest withDigestAuth(string $username, string $password)
28
+ * @method static \Illuminate\Http\Client\PendingRequest withHeaders(array $headers)
29
+ * @method static \Illuminate\Http\Client\PendingRequest withOptions(array $options)
30
+ * @method static \Illuminate\Http\Client\PendingRequest withToken(string $token, string $type = 'Bearer')
31
+ * @method static \Illuminate\Http\Client\PendingRequest withoutRedirecting()
32
+ * @method static \Illuminate\Http\Client\PendingRequest withoutVerifying()
33
+ * @method static \Illuminate\Http\Client\PendingRequest dump()
34
+ * @method static \Illuminate\Http\Client\PendingRequest dd()
35
+ * @method static \Illuminate\Http\Client\Response delete(string $url, array $data = [])
36
+ * @method static \Illuminate\Http\Client\Response get(string $url, array $query = [])
37
+ * @method static \Illuminate\Http\Client\Response head(string $url, array $query = [])
38
+ * @method static \Illuminate\Http\Client\Response patch(string $url, array $data = [])
39
+ * @method static \Illuminate\Http\Client\Response post(string $url, array $data = [])
40
+ * @method static \Illuminate\Http\Client\Response put(string $url, array $data = [])
41
+ * @method static \Illuminate\Http\Client\Response send(string $method, string $url, array $options = [])
42
+ * @method static \Illuminate\Http\Client\ResponseSequence fakeSequence(string $urlPattern = '*')
43
+ * @method static void assertSent(callable $callback)
44
+ * @method static void assertNotSent(callable $callback)
45
+ * @method static void assertNothingSent()
46
+ * @method static void assertSentCount(int $count)
47
+ * @method static void assertSequencesAreEmpty()
48
+ *
49
+ * @see \Illuminate\Http\Client\Factory
50
+ */
51
+ class Http extends Facade
52
+ {
53
+ /**
54
+ * Get the registered name of the component.
55
+ *
56
+ * @return string
57
+ */
58
+ protected static function getFacadeAccessor()
59
+ {
60
+ return Factory::class;
61
+ }
62
+ }
vendor/illuminate/support/Facades/Input.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
-
3
- namespace Illuminate\Support\Facades;
4
-
5
- /**
6
- * @see \Illuminate\Http\Request
7
- */
8
- class Input extends Facade
9
- {
10
- /**
11
- * Get an item from the input data.
12
- *
13
- * This method is used for all request verbs (GET, POST, PUT, and DELETE)
14
- *
15
- * @param string $key
16
- * @param mixed $default
17
- * @return mixed
18
- */
19
- public static function get($key = null, $default = null)
20
- {
21
- return static::$app['request']->input($key, $default);
22
- }
23
-
24
- /**
25
- * Get the registered name of the component.
26
- *
27
- * @return string
28
- */
29
- protected static function getFacadeAccessor()
30
- {
31
- return 'request';
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/illuminate/support/Facades/Lang.php CHANGED
@@ -3,6 +3,12 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
6
  * @see \Illuminate\Translation\Translator
7
  */
8
  class Lang extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static bool has(string $key)
7
+ * @method static mixed get(string $key, array $replace = [], string $locale = null, bool $fallback = true)
8
+ * @method static string choice(string $key, \Countable|int|array $number, array $replace = [], string $locale = null)
9
+ * @method static string getLocale()
10
+ * @method static void setLocale(string $locale)
11
+ *
12
  * @see \Illuminate\Translation\Translator
13
  */
14
  class Lang extends Facade
vendor/illuminate/support/Facades/Log.php CHANGED
@@ -2,10 +2,22 @@
2
 
3
  namespace Illuminate\Support\Facades;
4
 
5
- use Psr\Log\LoggerInterface;
6
-
7
  /**
8
- * @see \Illuminate\Log\Writer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  */
10
  class Log extends Facade
11
  {
@@ -16,6 +28,6 @@ class Log extends Facade
16
  */
17
  protected static function getFacadeAccessor()
18
  {
19
- return LoggerInterface::class;
20
  }
21
  }
2
 
3
  namespace Illuminate\Support\Facades;
4
 
 
 
5
  /**
6
+ * @method static \Psr\Log\LoggerInterface channel(string $channel = null)
7
+ * @method static \Psr\Log\LoggerInterface stack(array $channels, string $channel = null)
8
+ * @method static void alert(string $message, array $context = [])
9
+ * @method static void critical(string $message, array $context = [])
10
+ * @method static void debug(string $message, array $context = [])
11
+ * @method static void emergency(string $message, array $context = [])
12
+ * @method static void error(string $message, array $context = [])
13
+ * @method static void info(string $message, array $context = [])
14
+ * @method static void log($level, string $message, array $context = [])
15
+ * @method static void notice(string $message, array $context = [])
16
+ * @method static void warning(string $message, array $context = [])
17
+ * @method static void write(string $level, string $message, array $context = [])
18
+ * @method static void listen(\Closure $callback)
19
+ *
20
+ * @see \Illuminate\Log\Logger
21
  */
22
  class Log extends Facade
23
  {
28
  */
29
  protected static function getFacadeAccessor()
30
  {
31
+ return 'log';
32
  }
33
  }
vendor/illuminate/support/Facades/Mail.php CHANGED
@@ -5,18 +5,44 @@ namespace Illuminate\Support\Facades;
5
  use Illuminate\Support\Testing\Fakes\MailFake;
6
 
7
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  * @see \Illuminate\Mail\Mailer
 
9
  */
10
  class Mail extends Facade
11
  {
12
  /**
13
  * Replace the bound instance with a fake.
14
  *
15
- * @return void
16
  */
17
  public static function fake()
18
  {
19
- static::swap(new MailFake);
 
 
20
  }
21
 
22
  /**
@@ -26,6 +52,6 @@ class Mail extends Facade
26
  */
27
  protected static function getFacadeAccessor()
28
  {
29
- return 'mailer';
30
  }
31
  }
5
  use Illuminate\Support\Testing\Fakes\MailFake;
6
 
7
  /**
8
+ * @method static \Illuminate\Mail\Mailer mailer(string|null $name = null)
9
+ * @method static \Illuminate\Mail\PendingMail bcc($users)
10
+ * @method static \Illuminate\Mail\PendingMail to($users)
11
+ * @method static \Illuminate\Support\Collection queued(string $mailable, \Closure|string $callback = null)
12
+ * @method static \Illuminate\Support\Collection sent(string $mailable, \Closure|string $callback = null)
13
+ * @method static array failures()
14
+ * @method static bool hasQueued(string $mailable)
15
+ * @method static bool hasSent(string $mailable)
16
+ * @method static mixed later(\DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable|string|array $view, string $queue = null)
17
+ * @method static mixed laterOn(string $queue, \DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable|string|array $view)
18
+ * @method static mixed queue(\Illuminate\Contracts\Mail\Mailable|string|array $view, string $queue = null)
19
+ * @method static mixed queueOn(string $queue, \Illuminate\Contracts\Mail\Mailable|string|array $view)
20
+ * @method static void assertNotQueued(string $mailable, callable $callback = null)
21
+ * @method static void assertNotSent(string $mailable, callable|int $callback = null)
22
+ * @method static void assertNothingQueued()
23
+ * @method static void assertNothingSent()
24
+ * @method static void assertQueued(string|\Closure $mailable, callable|int $callback = null)
25
+ * @method static void assertSent(string|\Closure $mailable, callable|int $callback = null)
26
+ * @method static void raw(string $text, $callback)
27
+ * @method static void plain(string $view, array $data, $callback)
28
+ * @method static void html(string $html, $callback)
29
+ * @method static void send(\Illuminate\Contracts\Mail\Mailable|string|array $view, array $data = [], \Closure|string $callback = null)
30
+ *
31
  * @see \Illuminate\Mail\Mailer
32
+ * @see \Illuminate\Support\Testing\Fakes\MailFake
33
  */
34
  class Mail extends Facade
35
  {
36
  /**
37
  * Replace the bound instance with a fake.
38
  *
39
+ * @return \Illuminate\Support\Testing\Fakes\MailFake
40
  */
41
  public static function fake()
42
  {
43
+ static::swap($fake = new MailFake);
44
+
45
+ return $fake;
46
  }
47
 
48
  /**
52
  */
53
  protected static function getFacadeAccessor()
54
  {
55
+ return 'mail.manager';
56
  }
57
  }
vendor/illuminate/support/Facades/Notification.php CHANGED
@@ -2,10 +2,23 @@
2
 
3
  namespace Illuminate\Support\Facades;
4
 
 
5
  use Illuminate\Notifications\ChannelManager;
6
  use Illuminate\Support\Testing\Fakes\NotificationFake;
7
 
8
  /**
 
 
 
 
 
 
 
 
 
 
 
 
9
  * @see \Illuminate\Notifications\ChannelManager
10
  */
11
  class Notification extends Facade
@@ -13,11 +26,25 @@ class Notification extends Facade
13
  /**
14
  * Replace the bound instance with a fake.
15
  *
16
- * @return void
17
  */
18
  public static function fake()
19
  {
20
- static::swap(new NotificationFake);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
  /**
2
 
3
  namespace Illuminate\Support\Facades;
4
 
5
+ use Illuminate\Notifications\AnonymousNotifiable;
6
  use Illuminate\Notifications\ChannelManager;
7
  use Illuminate\Support\Testing\Fakes\NotificationFake;
8
 
9
  /**
10
+ * @method static \Illuminate\Notifications\ChannelManager locale(string|null $locale)
11
+ * @method static \Illuminate\Support\Collection sent(mixed $notifiable, string $notification, callable $callback = null)
12
+ * @method static bool hasSent(mixed $notifiable, string $notification)
13
+ * @method static mixed channel(string|null $name = null)
14
+ * @method static void assertNotSentTo(mixed $notifiable, string|\Closure $notification, callable $callback = null)
15
+ * @method static void assertNothingSent()
16
+ * @method static void assertSentTo(mixed $notifiable, string|\Closure $notification, callable $callback = null)
17
+ * @method static void assertSentToTimes(mixed $notifiable, string $notification, int $times = 1)
18
+ * @method static void assertTimesSent(int $expectedCount, string $notification)
19
+ * @method static void send(\Illuminate\Support\Collection|array|mixed $notifiables, $notification)
20
+ * @method static void sendNow(\Illuminate\Support\Collection|array|mixed $notifiables, $notification)
21
+ *
22
  * @see \Illuminate\Notifications\ChannelManager
23
  */
24
  class Notification extends Facade
26
  /**
27
  * Replace the bound instance with a fake.
28
  *
29
+ * @return \Illuminate\Support\Testing\Fakes\NotificationFake
30
  */
31
  public static function fake()
32
  {
33
+ static::swap($fake = new NotificationFake);
34
+
35
+ return $fake;
36
+ }
37
+
38
+ /**
39
+ * Begin sending a notification to an anonymous notifiable.
40
+ *
41
+ * @param string $channel
42
+ * @param mixed $route
43
+ * @return \Illuminate\Notifications\AnonymousNotifiable
44
+ */
45
+ public static function route($channel, $route)
46
+ {
47
+ return (new AnonymousNotifiable)->route($channel, $route);
48
  }
49
 
50
  /**
vendor/illuminate/support/Facades/ParallelTesting.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Facades;
4
+
5
+ /**
6
+ * @method static void setUpProcess(callable $callback)
7
+ * @method static void setUpTestCase(callable $callback)
8
+ * @method static void setUpTestDatabase(callable $callback)
9
+ * @method static void tearDownProcess(callable $callback)
10
+ * @method static void tearDownTestCase(callable $callback)
11
+ * @method static int|false token()
12
+ *
13
+ * @see \Illuminate\Testing\ParallelTesting
14
+ */
15
+ class ParallelTesting extends Facade
16
+ {
17
+ /**
18
+ * Get the registered name of the component.
19
+ *
20
+ * @return string
21
+ */
22
+ protected static function getFacadeAccessor()
23
+ {
24
+ return \Illuminate\Testing\ParallelTesting::class;
25
+ }
26
+ }
vendor/illuminate/support/Facades/Password.php CHANGED
@@ -2,7 +2,18 @@
2
 
3
  namespace Illuminate\Support\Facades;
4
 
 
 
5
  /**
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Auth\Passwords\PasswordBroker
7
  */
8
  class Password extends Facade
@@ -12,35 +23,35 @@ class Password extends Facade
12
  *
13
  * @var string
14
  */
15
- const RESET_LINK_SENT = 'passwords.sent';
16
 
17
  /**
18
  * Constant representing a successfully reset password.
19
  *
20
  * @var string
21
  */
22
- const PASSWORD_RESET = 'passwords.reset';
23
 
24
  /**
25
  * Constant representing the user not found response.
26
  *
27
  * @var string
28
  */
29
- const INVALID_USER = 'passwords.user';
30
 
31
  /**
32
- * Constant representing an invalid password.
33
  *
34
  * @var string
35
  */
36
- const INVALID_PASSWORD = 'passwords.password';
37
 
38
  /**
39
- * Constant representing an invalid token.
40
  *
41
  * @var string
42
  */
43
- const INVALID_TOKEN = 'passwords.token';
44
 
45
  /**
46
  * Get the registered name of the component.
2
 
3
  namespace Illuminate\Support\Facades;
4
 
5
+ use Illuminate\Contracts\Auth\PasswordBroker;
6
+
7
  /**
8
+ * @method static mixed reset(array $credentials, \Closure $callback)
9
+ * @method static string sendResetLink(array $credentials, \Closure $callback = null)
10
+ * @method static \Illuminate\Contracts\Auth\CanResetPassword getUser(array $credentials)
11
+ * @method static string createToken(\Illuminate\Contracts\Auth\CanResetPassword $user)
12
+ * @method static void deleteToken(\Illuminate\Contracts\Auth\CanResetPassword $user)
13
+ * @method static bool tokenExists(\Illuminate\Contracts\Auth\CanResetPassword $user, string $token)
14
+ * @method static \Illuminate\Auth\Passwords\TokenRepositoryInterface getRepository()
15
+ * @method static \Illuminate\Contracts\Auth\PasswordBroker broker(string|null $name = null)
16
+ *
17
  * @see \Illuminate\Auth\Passwords\PasswordBroker
18
  */
19
  class Password extends Facade
23
  *
24
  * @var string
25
  */
26
+ const RESET_LINK_SENT = PasswordBroker::RESET_LINK_SENT;
27
 
28
  /**
29
  * Constant representing a successfully reset password.
30
  *
31
  * @var string
32
  */
33
+ const PASSWORD_RESET = PasswordBroker::PASSWORD_RESET;
34
 
35
  /**
36
  * Constant representing the user not found response.
37
  *
38
  * @var string
39
  */
40
+ const INVALID_USER = PasswordBroker::INVALID_USER;
41
 
42
  /**
43
+ * Constant representing an invalid token.
44
  *
45
  * @var string
46
  */
47
+ const INVALID_TOKEN = PasswordBroker::INVALID_TOKEN;
48
 
49
  /**
50
+ * Constant representing a throttled reset attempt.
51
  *
52
  * @var string
53
  */
54
+ const RESET_THROTTLED = PasswordBroker::RESET_THROTTLED;
55
 
56
  /**
57
  * Get the registered name of the component.
vendor/illuminate/support/Facades/Queue.php CHANGED
@@ -2,22 +2,54 @@
2
 
3
  namespace Illuminate\Support\Facades;
4
 
 
5
  use Illuminate\Support\Testing\Fakes\QueueFake;
6
 
7
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  * @see \Illuminate\Queue\QueueManager
9
  * @see \Illuminate\Queue\Queue
10
  */
11
  class Queue extends Facade
12
  {
13
  /**
14
- * Replace the bound instance with a fake.
15
  *
 
 
16
  * @return void
17
  */
 
 
 
 
 
 
 
 
 
 
18
  public static function fake()
19
  {
20
- static::swap(new QueueFake(static::getFacadeApplication()));
 
 
21
  }
22
 
23
  /**
2
 
3
  namespace Illuminate\Support\Facades;
4
 
5
+ use Illuminate\Queue\Worker;
6
  use Illuminate\Support\Testing\Fakes\QueueFake;
7
 
8
  /**
9
+ * @method static \Illuminate\Contracts\Queue\Job|null pop(string $queue = null)
10
+ * @method static \Illuminate\Contracts\Queue\Queue setConnectionName(string $name)
11
+ * @method static int size(string $queue = null)
12
+ * @method static mixed bulk(array $jobs, mixed $data = '', string $queue = null)
13
+ * @method static mixed later(\DateTimeInterface|\DateInterval|int $delay, string|object $job, mixed $data = '', string $queue = null)
14
+ * @method static mixed laterOn(string $queue, \DateTimeInterface|\DateInterval|int $delay, string|object $job, mixed $data = '')
15
+ * @method static mixed push(string|object $job, mixed $data = '', $queue = null)
16
+ * @method static mixed pushOn(string $queue, string|object $job, mixed $data = '')
17
+ * @method static mixed pushRaw(string $payload, string $queue = null, array $options = [])
18
+ * @method static string getConnectionName()
19
+ * @method static void assertNotPushed(string|\Closure $job, callable $callback = null)
20
+ * @method static void assertNothingPushed()
21
+ * @method static void assertPushed(string|\Closure $job, callable|int $callback = null)
22
+ * @method static void assertPushedOn(string $queue, string|\Closure $job, callable|int $callback = null)
23
+ * @method static void assertPushedWithChain(string $job, array $expectedChain = [], callable $callback = null)
24
+ * @method static void popUsing(string $workerName, callable $callback)
25
+ *
26
  * @see \Illuminate\Queue\QueueManager
27
  * @see \Illuminate\Queue\Queue
28
  */
29
  class Queue extends Facade
30
  {
31
  /**
32
+ * Register a callback to be executed to pick jobs.
33
  *
34
+ * @param string $workerName
35
+ * @param callable $callback
36
  * @return void
37
  */
38
+ public static function popUsing($workerName, $callback)
39
+ {
40
+ return Worker::popUsing($workerName, $callback);
41
+ }
42
+
43
+ /**
44
+ * Replace the bound instance with a fake.
45
+ *
46
+ * @return \Illuminate\Support\Testing\Fakes\QueueFake
47
+ */
48
  public static function fake()
49
  {
50
+ static::swap($fake = new QueueFake(static::getFacadeApplication()));
51
+
52
+ return $fake;
53
  }
54
 
55
  /**
vendor/illuminate/support/Facades/RateLimiter.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Facades;
4
+
5
+ /**
6
+ * @method static \Illuminate\Cache\RateLimiter for(string $name, \Closure $callback)
7
+ * @method static \Closure limiter(string $name)
8
+ * @method static bool tooManyAttempts($key, $maxAttempts)
9
+ * @method static int hit($key, $decaySeconds = 60)
10
+ * @method static mixed attempts($key)
11
+ * @method static mixed resetAttempts($key)
12
+ * @method static int retriesLeft($key, $maxAttempts)
13
+ * @method static void clear($key)
14
+ * @method static int availableIn($key)
15
+ *
16
+ * @see \Illuminate\Cache\RateLimiter
17
+ */
18
+ class RateLimiter extends Facade
19
+ {
20
+ /**
21
+ * Get the registered name of the component.
22
+ *
23
+ * @return string
24
+ */
25
+ protected static function getFacadeAccessor()
26
+ {
27
+ return 'Illuminate\Cache\RateLimiter';
28
+ }
29
+ }
vendor/illuminate/support/Facades/Redirect.php CHANGED
@@ -3,6 +3,22 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Routing\Redirector
7
  */
8
  class Redirect extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Illuminate\Http\RedirectResponse action(string $action, array $parameters = [], int $status = 302, array $headers = [])
7
+ * @method static \Illuminate\Http\RedirectResponse away(string $path, int $status = 302, array $headers = [])
8
+ * @method static \Illuminate\Http\RedirectResponse back(int $status = 302, array $headers = [], $fallback = false)
9
+ * @method static \Illuminate\Http\RedirectResponse guest(string $path, int $status = 302, array $headers = [], bool $secure = null)
10
+ * @method static \Illuminate\Http\RedirectResponse home(int $status = 302)
11
+ * @method static \Illuminate\Http\RedirectResponse intended(string $default = '/', int $status = 302, array $headers = [], bool $secure = null)
12
+ * @method static \Illuminate\Http\RedirectResponse refresh(int $status = 302, array $headers = [])
13
+ * @method static \Illuminate\Http\RedirectResponse route(string $route, array $parameters = [], int $status = 302, array $headers = [])
14
+ * @method static \Illuminate\Http\RedirectResponse secure(string $path, int $status = 302, array $headers = [])
15
+ * @method static \Illuminate\Http\RedirectResponse signedRoute(string $name, array $parameters = [], \DateTimeInterface|\DateInterval|int $expiration = null, int $status = 302, array $headers = [])
16
+ * @method static \Illuminate\Http\RedirectResponse temporarySignedRoute(string $name, \DateTimeInterface|\DateInterval|int $expiration, array $parameters = [], int $status = 302, array $headers = [])
17
+ * @method static \Illuminate\Http\RedirectResponse to(string $path, int $status = 302, array $headers = [], bool $secure = null)
18
+ * @method static \Illuminate\Routing\UrlGenerator getUrlGenerator()
19
+ * @method static void setSession(\Illuminate\Session\Store $session)
20
+ * @method static void setIntendedUrl(string $url)
21
+ *
22
  * @see \Illuminate\Routing\Redirector
23
  */
24
  class Redirect extends Facade
vendor/illuminate/support/Facades/Redis.php CHANGED
@@ -3,6 +3,10 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
6
  * @see \Illuminate\Redis\RedisManager
7
  * @see \Illuminate\Contracts\Redis\Factory
8
  */
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Illuminate\Redis\Connections\Connection connection(string $name = null)
7
+ * @method static \Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder funnel(string $name)
8
+ * @method static \Illuminate\Redis\Limiters\DurationLimiterBuilder throttle(string $name)
9
+ *
10
  * @see \Illuminate\Redis\RedisManager
11
  * @see \Illuminate\Contracts\Redis\Factory
12
  */
vendor/illuminate/support/Facades/Request.php CHANGED
@@ -3,6 +3,90 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Http\Request
7
  */
8
  class Request extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Closure getRouteResolver()
7
+ * @method static \Closure getUserResolver()
8
+ * @method static \Illuminate\Http\Request capture()
9
+ * @method static \Illuminate\Http\Request createFrom(\Illuminate\Http\Request $from, \Illuminate\Http\Request|null $to = null)
10
+ * @method static \Illuminate\Http\Request createFromBase(\Symfony\Component\HttpFoundation\Request $request)
11
+ * @method static \Illuminate\Http\Request duplicate(array|null $query = null, array|null $request = null, array|null $attributes = null, array|null $cookies = null, array|null $files = null, array|null $server = null)
12
+ * @method static \Illuminate\Http\Request instance()
13
+ * @method static \Illuminate\Http\Request merge(array $input)
14
+ * @method static \Illuminate\Http\Request replace(array $input)
15
+ * @method static \Illuminate\Http\Request setJson(\Symfony\Component\HttpFoundation\ParameterBag $json)
16
+ * @method static \Illuminate\Http\Request setRouteResolver(\Closure $callback)
17
+ * @method static \Illuminate\Http\Request setUserResolver(\Closure $callback)
18
+ * @method static \Illuminate\Http\UploadedFile|\Illuminate\Http\UploadedFile[]|array|null file(string|null $key = null, mixed $default = null)
19
+ * @method static \Illuminate\Routing\Route|object|string route(string|null $param = null, string|null $default = null)
20
+ * @method static \Illuminate\Session\Store session()
21
+ * @method static \Illuminate\Session\Store|null getSession()
22
+ * @method static \Symfony\Component\HttpFoundation\ParameterBag|mixed json(string|null $key = null, mixed $default = null)
23
+ * @method static array all(array|mixed|null $keys = null)
24
+ * @method static array allFiles()
25
+ * @method static array except(array|mixed $keys)
26
+ * @method static array ips()
27
+ * @method static array keys()
28
+ * @method static array only(array|mixed $keys)
29
+ * @method static array segments()
30
+ * @method static array toArray()
31
+ * @method static array validate(array $rules, ...$params)
32
+ * @method static array validateWithBag(string $errorBag, array $rules, ...$params)
33
+ * @method static bool accepts(string|array $contentTypes)
34
+ * @method static bool acceptsAnyContentType()
35
+ * @method static bool acceptsHtml()
36
+ * @method static bool acceptsJson()
37
+ * @method static bool ajax()
38
+ * @method static bool anyFilled(string|array $key)
39
+ * @method static bool exists(string|array $key)
40
+ * @method static bool expectsJson()
41
+ * @method static bool filled(string|array $key)
42
+ * @method static bool fullUrlIs(mixed ...$patterns)
43
+ * @method static bool has(string|array $key)
44
+ * @method static bool hasAny(string|array $key)
45
+ * @method static bool hasCookie(string $key)
46
+ * @method static bool hasFile(string $key)
47
+ * @method static bool hasHeader(string $key)
48
+ * @method static bool hasValidSignature(bool $absolute = true)
49
+ * @method static bool is(mixed ...$patterns)
50
+ * @method static bool isJson()
51
+ * @method static bool matchesType(string $actual, string $type)
52
+ * @method static bool offsetExists(string $offset)
53
+ * @method static bool pjax()
54
+ * @method static bool prefers(string|array $contentTypes)
55
+ * @method static bool prefetch()
56
+ * @method static bool routeIs(mixed ...$patterns)
57
+ * @method static bool secure()
58
+ * @method static bool wantsJson()
59
+ * @method static mixed filterFiles(mixed $files)
60
+ * @method static mixed offsetGet(string $offset)
61
+ * @method static mixed user(string|null $guard = null)
62
+ * @method static string decodedPath()
63
+ * @method static string fingerprint()
64
+ * @method static string format($default = 'html')
65
+ * @method static string fullUrl()
66
+ * @method static string fullUrlWithQuery(array $query)
67
+ * @method static string method()
68
+ * @method static string path()
69
+ * @method static string root()
70
+ * @method static string url()
71
+ * @method static string userAgent()
72
+ * @method static string|array old(string|null $key = null, string|array|null $default = null)
73
+ * @method static string|array|null cookie(string|null $key = null, string|array|null $default = null)
74
+ * @method static string|array|null header(string|null $key = null, string|array|null $default = null)
75
+ * @method static string|array|null input(string|null $key = null, string|array|null $default = null)
76
+ * @method static string|array|null post(string|null $key = null, string|array|null $default = null)
77
+ * @method static string|array|null query(string|null $key = null, string|array|null $default = null)
78
+ * @method static string|array|null server(string|null $key = null, string|array|null $default = null)
79
+ * @method static string|null bearerToken()
80
+ * @method static string|null ip()
81
+ * @method static string|null segment(int $index, string|null $default = null)
82
+ * @method static void flash()
83
+ * @method static void flashExcept(array|mixed $keys)
84
+ * @method static void flashOnly(array|mixed $keys)
85
+ * @method static void flush()
86
+ * @method static void offsetSet(string $offset, mixed $value)
87
+ * @method static void offsetUnset(string $offset)
88
+ * @method static void setLaravelSession(\Illuminate\Contracts\Session\Session $session)
89
+ *
90
  * @see \Illuminate\Http\Request
91
  */
92
  class Request extends Facade
vendor/illuminate/support/Facades/Response.php CHANGED
@@ -5,6 +5,21 @@ namespace Illuminate\Support\Facades;
5
  use Illuminate\Contracts\Routing\ResponseFactory as ResponseFactoryContract;
6
 
7
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  * @see \Illuminate\Contracts\Routing\ResponseFactory
9
  */
10
  class Response extends Facade
5
  use Illuminate\Contracts\Routing\ResponseFactory as ResponseFactoryContract;
6
 
7
  /**
8
+ * @method static \Illuminate\Http\JsonResponse json(string|array $data = [], int $status = 200, array $headers = [], int $options = 0)
9
+ * @method static \Illuminate\Http\JsonResponse jsonp(string $callback, string|array $data = [], int $status = 200, array $headers = [], int $options = 0)
10
+ * @method static \Illuminate\Http\RedirectResponse redirectGuest(string $path, int $status = 302, array $headers = [], bool|null $secure = null)
11
+ * @method static \Illuminate\Http\RedirectResponse redirectTo(string $path, int $status = 302, array $headers = [], bool|null $secure = null)
12
+ * @method static \Illuminate\Http\RedirectResponse redirectToAction(string $action, mixed $parameters = [], int $status = 302, array $headers = [])
13
+ * @method static \Illuminate\Http\RedirectResponse redirectToIntended(string $default = '/', int $status = 302, array $headers = [], bool|null $secure = null)
14
+ * @method static \Illuminate\Http\RedirectResponse redirectToRoute(string $route, mixed $parameters = [], int $status = 302, array $headers = [])
15
+ * @method static \Illuminate\Http\Response make(string $content = '', int $status = 200, array $headers = [])
16
+ * @method static \Illuminate\Http\Response noContent($status = 204, array $headers = [])
17
+ * @method static \Illuminate\Http\Response view(string $view, array $data = [], int $status = 200, array $headers = [])
18
+ * @method static \Symfony\Component\HttpFoundation\BinaryFileResponse download(\SplFileInfo|string $file, string|null $name = null, array $headers = [], string|null $disposition = 'attachment')
19
+ * @method static \Symfony\Component\HttpFoundation\BinaryFileResponse file($file, array $headers = [])
20
+ * @method static \Symfony\Component\HttpFoundation\StreamedResponse stream(\Closure $callback, int $status = 200, array $headers = [])
21
+ * @method static \Symfony\Component\HttpFoundation\StreamedResponse streamDownload(\Closure $callback, string|null $name = null, array $headers = [], string|null $disposition = 'attachment')
22
+ *
23
  * @see \Illuminate\Contracts\Routing\ResponseFactory
24
  */
25
  class Response extends Facade
vendor/illuminate/support/Facades/Route.php CHANGED
@@ -3,21 +3,45 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
- * @method static \Illuminate\Routing\Route get(string $uri, \Closure|array|string|null $action = null)
7
- * @method static \Illuminate\Routing\Route post(string $uri, \Closure|array|string|null $action = null)
8
- * @method static \Illuminate\Routing\Route put(string $uri, \Closure|array|string|null $action = null)
9
- * @method static \Illuminate\Routing\Route delete(string $uri, \Closure|array|string|null $action = null)
10
- * @method static \Illuminate\Routing\Route patch(string $uri, \Closure|array|string|null $action = null)
11
- * @method static \Illuminate\Routing\Route options(string $uri, \Closure|array|string|null $action = null)
12
- * @method static \Illuminate\Routing\Route any(string $uri, \Closure|array|string|null $action = null)
13
- * @method static \Illuminate\Routing\Route match(array|string $methods, string $uri, \Closure|array|string|null $action = null)
14
- * @method static \Illuminate\Routing\Route prefix(string $prefix)
15
- * @method static void resource(string $name, string $controller, array $options = [])
16
- * @method static void apiResource(string $name, string $controller, array $options = [])
17
- * @method static void group(array $attributes, \Closure|string $callback)
18
- * @method static \Illuminate\Routing\Route middleware(array|string|null $middleware)
19
- * @method static \Illuminate\Routing\Route substituteBindings(\Illuminate\Routing\Route $route)
20
- * @method static void substituteImplicitBindings(\Illuminate\Routing\Route $route)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  *
22
  * @see \Illuminate\Routing\Router
23
  */
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Illuminate\Routing\PendingResourceRegistration apiResource(string $name, string $controller, array $options = [])
7
+ * @method static \Illuminate\Routing\PendingResourceRegistration resource(string $name, string $controller, array $options = [])
8
+ * @method static \Illuminate\Routing\Route any(string $uri, array|string|callable|null $action = null)
9
+ * @method static \Illuminate\Routing\Route|null current()
10
+ * @method static \Illuminate\Routing\Route delete(string $uri, array|string|callable|null $action = null)
11
+ * @method static \Illuminate\Routing\Route fallback(array|string|callable|null $action = null)
12
+ * @method static \Illuminate\Routing\Route get(string $uri, array|string|callable|null $action = null)
13
+ * @method static \Illuminate\Routing\Route|null getCurrentRoute()
14
+ * @method static \Illuminate\Routing\RouteCollectionInterface getRoutes()
15
+ * @method static \Illuminate\Routing\Route match(array|string $methods, string $uri, array|string|callable|null $action = null)
16
+ * @method static \Illuminate\Routing\Route options(string $uri, array|string|callable|null $action = null)
17
+ * @method static \Illuminate\Routing\Route patch(string $uri, array|string|callable|null $action = null)
18
+ * @method static \Illuminate\Routing\Route permanentRedirect(string $uri, string $destination)
19
+ * @method static \Illuminate\Routing\Route post(string $uri, array|string|callable|null $action = null)
20
+ * @method static \Illuminate\Routing\Route put(string $uri, array|string|callable|null $action = null)
21
+ * @method static \Illuminate\Routing\Route redirect(string $uri, string $destination, int $status = 302)
22
+ * @method static \Illuminate\Routing\Route substituteBindings(\Illuminate\Support\Facades\Route $route)
23
+ * @method static \Illuminate\Routing\Route view(string $uri, string $view, array $data = [], int $status = 200, array $headers = [])
24
+ * @method static \Illuminate\Routing\RouteRegistrar as(string $value)
25
+ * @method static \Illuminate\Routing\RouteRegistrar domain(string $value)
26
+ * @method static \Illuminate\Routing\RouteRegistrar middleware(array|string|null $middleware)
27
+ * @method static \Illuminate\Routing\RouteRegistrar name(string $value)
28
+ * @method static \Illuminate\Routing\RouteRegistrar namespace(string|null $value)
29
+ * @method static \Illuminate\Routing\RouteRegistrar prefix(string $prefix)
30
+ * @method static \Illuminate\Routing\RouteRegistrar where(array $where)
31
+ * @method static \Illuminate\Routing\Router|\Illuminate\Routing\RouteRegistrar group(\Closure|string|array $attributes, \Closure|string $routes)
32
+ * @method static \Illuminate\Routing\ResourceRegistrar resourceVerbs(array $verbs = [])
33
+ * @method static string|null currentRouteAction()
34
+ * @method static string|null currentRouteName()
35
+ * @method static void apiResources(array $resources, array $options = [])
36
+ * @method static void bind(string $key, string|callable $binder)
37
+ * @method static void model(string $key, string $class, \Closure|null $callback = null)
38
+ * @method static void pattern(string $key, string $pattern)
39
+ * @method static void resources(array $resources, array $options = [])
40
+ * @method static void substituteImplicitBindings(\Illuminate\Support\Facades\Route $route)
41
+ * @method static boolean uses(...$patterns)
42
+ * @method static boolean is(...$patterns)
43
+ * @method static boolean has(string $name)
44
+ * @method static mixed input(string $key, string|null $default = null)
45
  *
46
  * @see \Illuminate\Routing\Router
47
  */
vendor/illuminate/support/Facades/Schema.php CHANGED
@@ -4,9 +4,20 @@ namespace Illuminate\Support\Facades;
4
 
5
  /**
6
  * @method static \Illuminate\Database\Schema\Builder create(string $table, \Closure $callback)
 
 
7
  * @method static \Illuminate\Database\Schema\Builder drop(string $table)
 
8
  * @method static \Illuminate\Database\Schema\Builder dropIfExists(string $table)
 
 
9
  * @method static \Illuminate\Database\Schema\Builder table(string $table, \Closure $callback)
 
 
 
 
 
 
10
  *
11
  * @see \Illuminate\Database\Schema\Builder
12
  */
@@ -15,7 +26,7 @@ class Schema extends Facade
15
  /**
16
  * Get a schema builder instance for a connection.
17
  *
18
- * @param string $name
19
  * @return \Illuminate\Database\Schema\Builder
20
  */
21
  public static function connection($name)
4
 
5
  /**
6
  * @method static \Illuminate\Database\Schema\Builder create(string $table, \Closure $callback)
7
+ * @method static \Illuminate\Database\Schema\Builder createDatabase(string $name)
8
+ * @method static \Illuminate\Database\Schema\Builder disableForeignKeyConstraints()
9
  * @method static \Illuminate\Database\Schema\Builder drop(string $table)
10
+ * @method static \Illuminate\Database\Schema\Builder dropDatabaseIfExists(string $name)
11
  * @method static \Illuminate\Database\Schema\Builder dropIfExists(string $table)
12
+ * @method static \Illuminate\Database\Schema\Builder enableForeignKeyConstraints()
13
+ * @method static \Illuminate\Database\Schema\Builder rename(string $from, string $to)
14
  * @method static \Illuminate\Database\Schema\Builder table(string $table, \Closure $callback)
15
+ * @method static bool hasColumn(string $table, string $column)
16
+ * @method static bool hasColumns(string $table, array $columns)
17
+ * @method static bool dropColumns(string $table, array $columns)
18
+ * @method static bool hasTable(string $table)
19
+ * @method static void defaultStringLength(int $length)
20
+ * @method static void registerCustomDoctrineType(string $class, string $name, string $type)
21
  *
22
  * @see \Illuminate\Database\Schema\Builder
23
  */
26
  /**
27
  * Get a schema builder instance for a connection.
28
  *
29
+ * @param string|null $name
30
  * @return \Illuminate\Database\Schema\Builder
31
  */
32
  public static function connection($name)
vendor/illuminate/support/Facades/Session.php CHANGED
@@ -3,6 +3,31 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Session\SessionManager
7
  * @see \Illuminate\Session\Store
8
  */
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \SessionHandlerInterface getHandler()
7
+ * @method static array all()
8
+ * @method static bool exists(string|array $key)
9
+ * @method static bool handlerNeedsRequest()
10
+ * @method static bool has(string|array $key)
11
+ * @method static bool isStarted()
12
+ * @method static bool migrate(bool $destroy = false)
13
+ * @method static bool save()
14
+ * @method static bool start()
15
+ * @method static mixed get(string $key, $default = null)
16
+ * @method static mixed flash(string $class, string $message)
17
+ * @method static mixed pull(string $key, $default = null)
18
+ * @method static mixed remove(string $key)
19
+ * @method static string getId()
20
+ * @method static string getName()
21
+ * @method static string token()
22
+ * @method static string|null previousUrl()
23
+ * @method static void flush()
24
+ * @method static void forget(string|array $keys)
25
+ * @method static void push(string $key, mixed $value)
26
+ * @method static void put(string|array $key, $value = null)
27
+ * @method static void setId(string $id)
28
+ * @method static void setPreviousUrl(string $url)
29
+ * @method static void setRequestOnHandler(\Illuminate\Http\Request $request)
30
+ *
31
  * @see \Illuminate\Session\SessionManager
32
  * @see \Illuminate\Session\Store
33
  */
vendor/illuminate/support/Facades/Storage.php CHANGED
@@ -5,6 +5,37 @@ namespace Illuminate\Support\Facades;
5
  use Illuminate\Filesystem\Filesystem;
6
 
7
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  * @see \Illuminate\Filesystem\FilesystemManager
9
  */
10
  class Storage extends Facade
@@ -12,30 +43,45 @@ class Storage extends Facade
12
  /**
13
  * Replace the given disk with a local testing disk.
14
  *
15
- * @param string $disk
16
- *
17
- * @return void
18
  */
19
- public static function fake($disk)
20
  {
21
- (new Filesystem)->cleanDirectory(
22
- $root = storage_path('framework/testing/disks/'.$disk)
23
- );
 
 
 
 
 
 
24
 
25
- static::set($disk, self::createLocalDriver(['root' => $root]));
 
 
 
 
26
  }
27
 
28
  /**
29
  * Replace the given disk with a persistent local testing disk.
30
  *
31
- * @param string $disk
32
- * @return void
 
33
  */
34
- public static function persistentFake($disk)
35
  {
36
- static::set($disk, self::createLocalDriver([
 
 
37
  'root' => storage_path('framework/testing/disks/'.$disk),
38
- ]));
 
 
39
  }
40
 
41
  /**
5
  use Illuminate\Filesystem\Filesystem;
6
 
7
  /**
8
+ * @method static \Illuminate\Contracts\Filesystem\Filesystem assertExists(string|array $path)
9
+ * @method static \Illuminate\Contracts\Filesystem\Filesystem assertMissing(string|array $path)
10
+ * @method static \Illuminate\Contracts\Filesystem\Filesystem cloud()
11
+ * @method static \Illuminate\Contracts\Filesystem\Filesystem disk(string $name = null)
12
+ * @method static array allDirectories(string|null $directory = null)
13
+ * @method static array allFiles(string|null $directory = null)
14
+ * @method static array directories(string|null $directory = null, bool $recursive = false)
15
+ * @method static array files(string|null $directory = null, bool $recursive = false)
16
+ * @method static bool append(string $path, string $data)
17
+ * @method static bool copy(string $from, string $to)
18
+ * @method static bool delete(string|array $paths)
19
+ * @method static bool deleteDirectory(string $directory)
20
+ * @method static bool exists(string $path)
21
+ * @method static \Illuminate\Filesystem\FilesystemManager extend(string $driver, \Closure $callback)
22
+ * @method static bool makeDirectory(string $path)
23
+ * @method static bool move(string $from, string $to)
24
+ * @method static string path(string $path)
25
+ * @method static bool prepend(string $path, string $data)
26
+ * @method static bool put(string $path, string|resource $contents, mixed $options = [])
27
+ * @method static string|false putFile(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, mixed $options = [])
28
+ * @method static string|false putFileAs(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, string $name, mixed $options = [])
29
+ * @method static bool setVisibility(string $path, string $visibility)
30
+ * @method static bool writeStream(string $path, resource $resource, array $options = [])
31
+ * @method static int lastModified(string $path)
32
+ * @method static int size(string $path)
33
+ * @method static resource|null readStream(string $path)
34
+ * @method static string get(string $path)
35
+ * @method static string getVisibility(string $path)
36
+ * @method static string temporaryUrl(string $path, \DateTimeInterface $expiration, array $options = [])
37
+ * @method static string url(string $path)
38
+ *
39
  * @see \Illuminate\Filesystem\FilesystemManager
40
  */
41
  class Storage extends Facade
43
  /**
44
  * Replace the given disk with a local testing disk.
45
  *
46
+ * @param string|null $disk
47
+ * @param array $config
48
+ * @return \Illuminate\Contracts\Filesystem\Filesystem
49
  */
50
+ public static function fake($disk = null, array $config = [])
51
  {
52
+ $disk = $disk ?: static::$app['config']->get('filesystems.default');
53
+
54
+ $root = storage_path('framework/testing/disks/'.$disk);
55
+
56
+ if ($token = ParallelTesting::token()) {
57
+ $root = "{$root}_test_{$token}";
58
+ }
59
+
60
+ (new Filesystem)->cleanDirectory($root);
61
 
62
+ static::set($disk, $fake = static::createLocalDriver(array_merge($config, [
63
+ 'root' => $root,
64
+ ])));
65
+
66
+ return $fake;
67
  }
68
 
69
  /**
70
  * Replace the given disk with a persistent local testing disk.
71
  *
72
+ * @param string|null $disk
73
+ * @param array $config
74
+ * @return \Illuminate\Contracts\Filesystem\Filesystem
75
  */
76
+ public static function persistentFake($disk = null, array $config = [])
77
  {
78
+ $disk = $disk ?: static::$app['config']->get('filesystems.default');
79
+
80
+ static::set($disk, $fake = static::createLocalDriver(array_merge($config, [
81
  'root' => storage_path('framework/testing/disks/'.$disk),
82
+ ])));
83
+
84
+ return $fake;
85
  }
86
 
87
  /**
vendor/illuminate/support/Facades/URL.php CHANGED
@@ -3,6 +3,25 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\Routing\UrlGenerator
7
  */
8
  class URL extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Illuminate\Contracts\Routing\UrlGenerator setRootControllerNamespace(string $rootNamespace)
7
+ * @method static bool hasValidSignature(\Illuminate\Http\Request $request, bool $absolute = true)
8
+ * @method static string action(string|array $action, $parameters = [], bool $absolute = true)
9
+ * @method static string asset(string $path, bool $secure = null)
10
+ * @method static string secureAsset(string $path)
11
+ * @method static string current()
12
+ * @method static string full()
13
+ * @method static void macro(string $name, object|callable $macro)
14
+ * @method static void mixin(object $mixin, bool $replace = true)
15
+ * @method static string previous($fallback = false)
16
+ * @method static string route(string $name, $parameters = [], bool $absolute = true)
17
+ * @method static string secure(string $path, array $parameters = [])
18
+ * @method static string signedRoute(string $name, array $parameters = [], \DateTimeInterface|\DateInterval|int $expiration = null, bool $absolute = true)
19
+ * @method static string temporarySignedRoute(string $name, \DateTimeInterface|\DateInterval|int $expiration, array $parameters = [], bool $absolute = true)
20
+ * @method static string to(string $path, $extra = [], bool $secure = null)
21
+ * @method static void defaults(array $defaults)
22
+ * @method static void forceScheme(string $scheme)
23
+ * @method static bool isValidUrl(string $path)
24
+ *
25
  * @see \Illuminate\Routing\UrlGenerator
26
  */
27
  class URL extends Facade
vendor/illuminate/support/Facades/Validator.php CHANGED
@@ -3,6 +3,12 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
6
  * @see \Illuminate\Validation\Factory
7
  */
8
  class Validator extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Illuminate\Contracts\Validation\Validator make(array $data, array $rules, array $messages = [], array $customAttributes = [])
7
+ * @method static void extend(string $rule, \Closure|string $extension, string $message = null)
8
+ * @method static void extendImplicit(string $rule, \Closure|string $extension, string $message = null)
9
+ * @method static void replacer(string $rule, \Closure|string $replacer)
10
+ * @method static array validate(array $data, array $rules, array $messages = [], array $customAttributes = [])
11
+ *
12
  * @see \Illuminate\Validation\Factory
13
  */
14
  class Validator extends Facade
vendor/illuminate/support/Facades/View.php CHANGED
@@ -3,6 +3,16 @@
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
 
 
 
 
 
 
 
 
 
 
6
  * @see \Illuminate\View\Factory
7
  */
8
  class View extends Facade
3
  namespace Illuminate\Support\Facades;
4
 
5
  /**
6
+ * @method static \Illuminate\Contracts\View\Factory addNamespace(string $namespace, string|array $hints)
7
+ * @method static \Illuminate\Contracts\View\View first(array $views, \Illuminate\Contracts\Support\Arrayable|array $data = [], array $mergeData = [])
8
+ * @method static \Illuminate\Contracts\View\Factory replaceNamespace(string $namespace, string|array $hints)
9
+ * @method static \Illuminate\Contracts\View\View file(string $path, array $data = [], array $mergeData = [])
10
+ * @method static \Illuminate\Contracts\View\View make(string $view, array $data = [], array $mergeData = [])
11
+ * @method static array composer(array|string $views, \Closure|string $callback)
12
+ * @method static array creator(array|string $views, \Closure|string $callback)
13
+ * @method static bool exists(string $view)
14
+ * @method static mixed share(array|string $key, $value = null)
15
+ *
16
  * @see \Illuminate\View\Factory
17
  */
18
  class View extends Facade
vendor/illuminate/support/Fluent.php CHANGED
@@ -3,23 +3,23 @@
3
  namespace Illuminate\Support;
4
 
5
  use ArrayAccess;
6
- use JsonSerializable;
7
- use Illuminate\Contracts\Support\Jsonable;
8
  use Illuminate\Contracts\Support\Arrayable;
 
 
9
 
10
- class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
11
  {
12
  /**
13
- * All of the attributes set on the container.
14
  *
15
  * @var array
16
  */
17
  protected $attributes = [];
18
 
19
  /**
20
- * Create a new fluent container instance.
21
  *
22
- * @param array|object $attributes
23
  * @return void
24
  */
25
  public function __construct($attributes = [])
@@ -30,10 +30,10 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
30
  }
31
 
32
  /**
33
- * Get an attribute from the container.
34
  *
35
  * @param string $key
36
- * @param mixed $default
37
  * @return mixed
38
  */
39
  public function get($key, $default = null)
@@ -46,7 +46,7 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
46
  }
47
 
48
  /**
49
- * Get the attributes from the container.
50
  *
51
  * @return array
52
  */
@@ -56,7 +56,7 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
56
  }
57
 
58
  /**
59
- * Convert the Fluent instance to an array.
60
  *
61
  * @return array
62
  */
@@ -76,7 +76,7 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
76
  }
77
 
78
  /**
79
- * Convert the Fluent instance to JSON.
80
  *
81
  * @param int $options
82
  * @return string
@@ -94,7 +94,7 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
94
  */
95
  public function offsetExists($offset)
96
  {
97
- return isset($this->{$offset});
98
  }
99
 
100
  /**
@@ -105,19 +105,19 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
105
  */
106
  public function offsetGet($offset)
107
  {
108
- return $this->{$offset};
109
  }
110
 
111
  /**
112
  * Set the value at the given offset.
113
  *
114
  * @param string $offset
115
- * @param mixed $value
116
  * @return void
117
  */
118
  public function offsetSet($offset, $value)
119
  {
120
- $this->{$offset} = $value;
121
  }
122
 
123
  /**
@@ -128,14 +128,14 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
128
  */
129
  public function offsetUnset($offset)
130
  {
131
- unset($this->{$offset});
132
  }
133
 
134
  /**
135
- * Handle dynamic calls to the container to set attributes.
136
  *
137
  * @param string $method
138
- * @param array $parameters
139
  * @return $this
140
  */
141
  public function __call($method, $parameters)
@@ -160,12 +160,12 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
160
  * Dynamically set the value of an attribute.
161
  *
162
  * @param string $key
163
- * @param mixed $value
164
  * @return void
165
  */
166
  public function __set($key, $value)
167
  {
168
- $this->attributes[$key] = $value;
169
  }
170
 
171
  /**
@@ -176,7 +176,7 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
176
  */
177
  public function __isset($key)
178
  {
179
- return isset($this->attributes[$key]);
180
  }
181
 
182
  /**
@@ -187,6 +187,6 @@ class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable
187
  */
188
  public function __unset($key)
189
  {
190
- unset($this->attributes[$key]);
191
  }
192
  }
3
  namespace Illuminate\Support;
4
 
5
  use ArrayAccess;
 
 
6
  use Illuminate\Contracts\Support\Arrayable;
7
+ use Illuminate\Contracts\Support\Jsonable;
8
+ use JsonSerializable;
9
 
10
+ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable
11
  {
12
  /**
13
+ * All of the attributes set on the fluent instance.
14
  *
15
  * @var array
16
  */
17
  protected $attributes = [];
18
 
19
  /**
20
+ * Create a new fluent instance.
21
  *
22
+ * @param array|object $attributes
23
  * @return void
24
  */
25
  public function __construct($attributes = [])
30
  }
31
 
32
  /**
33
+ * Get an attribute from the fluent instance.
34
  *
35
  * @param string $key
36
+ * @param mixed $default
37
  * @return mixed
38
  */
39
  public function get($key, $default = null)
46
  }
47
 
48
  /**
49
+ * Get the attributes from the fluent instance.
50
  *
51
  * @return array
52
  */
56
  }
57
 
58
  /**
59
+ * Convert the fluent instance to an array.
60
  *
61
  * @return array
62
  */
76
  }
77
 
78
  /**
79
+ * Convert the fluent instance to JSON.
80
  *
81
  * @param int $options
82
  * @return string
94
  */
95
  public function offsetExists($offset)
96
  {
97
+ return isset($this->attributes[$offset]);
98
  }
99
 
100
  /**
105
  */
106
  public function offsetGet($offset)
107
  {
108
+ return $this->get($offset);
109
  }
110
 
111
  /**
112
  * Set the value at the given offset.
113
  *
114
  * @param string $offset
115
+ * @param mixed $value
116
  * @return void
117
  */
118
  public function offsetSet($offset, $value)
119
  {
120
+ $this->attributes[$offset] = $value;
121
  }
122
 
123
  /**
128
  */
129
  public function offsetUnset($offset)
130
  {
131
+ unset($this->attributes[$offset]);
132
  }
133
 
134
  /**
135
+ * Handle dynamic calls to the fluent instance to set attributes.
136
  *
137
  * @param string $method
138
+ * @param array $parameters
139
  * @return $this
140
  */
141
  public function __call($method, $parameters)
160
  * Dynamically set the value of an attribute.
161
  *
162
  * @param string $key
163
+ * @param mixed $value
164
  * @return void
165
  */
166
  public function __set($key, $value)
167
  {
168
+ $this->offsetSet($key, $value);
169
  }
170
 
171
  /**
176
  */
177
  public function __isset($key)
178
  {
179
+ return $this->offsetExists($key);
180
  }
181
 
182
  /**
187
  */
188
  public function __unset($key)
189
  {
190
+ $this->offsetUnset($key);
191
  }
192
  }
vendor/illuminate/support/HtmlString.php CHANGED
@@ -19,7 +19,7 @@ class HtmlString implements Htmlable
19
  * @param string $html
20
  * @return void
21
  */
22
- public function __construct($html)
23
  {
24
  $this->html = $html;
25
  }
@@ -34,6 +34,26 @@ class HtmlString implements Htmlable
34
  return $this->html;
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  /**
38
  * Get the HTML string.
39
  *
19
  * @param string $html
20
  * @return void
21
  */
22
+ public function __construct($html = '')
23
  {
24
  $this->html = $html;
25
  }
34
  return $this->html;
35
  }
36
 
37
+ /**
38
+ * Determine if the given HTML string is empty.
39
+ *
40
+ * @return bool
41
+ */
42
+ public function isEmpty()
43
+ {
44
+ return $this->html === '';
45
+ }
46
+
47
+ /**
48
+ * Determine if the given HTML string is not empty.
49
+ *
50
+ * @return bool
51
+ */
52
+ public function isNotEmpty()
53
+ {
54
+ return ! $this->isEmpty();
55
+ }
56
+
57
  /**
58
  * Get the HTML string.
59
  *
vendor/illuminate/support/InteractsWithTime.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use DateInterval;
6
+ use DateTimeInterface;
7
+
8
+ trait InteractsWithTime
9
+ {
10
+ /**
11
+ * Get the number of seconds until the given DateTime.
12
+ *
13
+ * @param \DateTimeInterface|\DateInterval|int $delay
14
+ * @return int
15
+ */
16
+ protected function secondsUntil($delay)
17
+ {
18
+ $delay = $this->parseDateInterval($delay);
19
+
20
+ return $delay instanceof DateTimeInterface
21
+ ? max(0, $delay->getTimestamp() - $this->currentTime())
22
+ : (int) $delay;
23
+ }
24
+
25
+ /**
26
+ * Get the "available at" UNIX timestamp.
27
+ *
28
+ * @param \DateTimeInterface|\DateInterval|int $delay
29
+ * @return int
30
+ */
31
+ protected function availableAt($delay = 0)
32
+ {
33
+ $delay = $this->parseDateInterval($delay);
34
+
35
+ return $delay instanceof DateTimeInterface
36
+ ? $delay->getTimestamp()
37
+ : Carbon::now()->addRealSeconds($delay)->getTimestamp();
38
+ }
39
+
40
+ /**
41
+ * If the given value is an interval, convert it to a DateTime instance.
42
+ *
43
+ * @param \DateTimeInterface|\DateInterval|int $delay
44
+ * @return \DateTimeInterface|int
45
+ */
46
+ protected function parseDateInterval($delay)
47
+ {
48
+ if ($delay instanceof DateInterval) {
49
+ $delay = Carbon::now()->add($delay);
50
+ }
51
+
52
+ return $delay;
53
+ }
54
+
55
+ /**
56
+ * Get the current system time as a UNIX timestamp.
57
+ *
58
+ * @return int
59
+ */
60
+ protected function currentTime()
61
+ {
62
+ return Carbon::now()->getTimestamp();
63
+ }
64
+ }
vendor/illuminate/support/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Taylor Otwell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
vendor/illuminate/support/Manager.php CHANGED
@@ -3,16 +3,24 @@
3
  namespace Illuminate\Support;
4
 
5
  use Closure;
 
6
  use InvalidArgumentException;
7
 
8
  abstract class Manager
9
  {
10
  /**
11
- * The application instance.
12
  *
13
- * @var \Illuminate\Foundation\Application
14
  */
15
- protected $app;
 
 
 
 
 
 
 
16
 
17
  /**
18
  * The registered custom driver creators.
@@ -31,12 +39,13 @@ abstract class Manager
31
  /**
32
  * Create a new manager instance.
33
  *
34
- * @param \Illuminate\Foundation\Application $app
35
  * @return void
36
  */
37
- public function __construct($app)
38
  {
39
- $this->app = $app;
 
40
  }
41
 
42
  /**
@@ -49,13 +58,21 @@ abstract class Manager
49
  /**
50
  * Get a driver instance.
51
  *
52
- * @param string $driver
53
  * @return mixed
 
 
54
  */
55
  public function driver($driver = null)
56
  {
57
  $driver = $driver ?: $this->getDefaultDriver();
58
 
 
 
 
 
 
 
59
  // If the given driver has not been created before, we will create the instances
60
  // here and cache it so we can return it next time very quickly. If there is
61
  // already a driver created by this name, we'll just return that instance.
@@ -76,9 +93,9 @@ abstract class Manager
76
  */
77
  protected function createDriver($driver)
78
  {
79
- // We'll check to see if a creator method exists for the given driver. If not we
80
- // will check for a custom driver creator, which allows developers to create
81
- // drivers using their own customized driver creator Closure to create it.
82
  if (isset($this->customCreators[$driver])) {
83
  return $this->callCustomCreator($driver);
84
  } else {
@@ -88,6 +105,7 @@ abstract class Manager
88
  return $this->$method();
89
  }
90
  }
 
91
  throw new InvalidArgumentException("Driver [$driver] not supported.");
92
  }
93
 
@@ -99,13 +117,13 @@ abstract class Manager
99
  */
100
  protected function callCustomCreator($driver)
101
  {
102
- return $this->customCreators[$driver]($this->app);
103
  }
104
 
105
  /**
106
  * Register a custom driver creator Closure.
107
  *
108
- * @param string $driver
109
  * @param \Closure $callback
110
  * @return $this
111
  */
@@ -126,11 +144,46 @@ abstract class Manager
126
  return $this->drivers;
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  /**
130
  * Dynamically call the default driver instance.
131
  *
132
  * @param string $method
133
- * @param array $parameters
134
  * @return mixed
135
  */
136
  public function __call($method, $parameters)
3
  namespace Illuminate\Support;
4
 
5
  use Closure;
6
+ use Illuminate\Contracts\Container\Container;
7
  use InvalidArgumentException;
8
 
9
  abstract class Manager
10
  {
11
  /**
12
+ * The container instance.
13
  *
14
+ * @var \Illuminate\Contracts\Container\Container
15
  */
16
+ protected $container;
17
+
18
+ /**
19
+ * The configuration repository instance.
20
+ *
21
+ * @var \Illuminate\Contracts\Config\Repository
22
+ */
23
+ protected $config;
24
 
25
  /**
26
  * The registered custom driver creators.
39
  /**
40
  * Create a new manager instance.
41
  *
42
+ * @param \Illuminate\Contracts\Container\Container $container
43
  * @return void
44
  */
45
+ public function __construct(Container $container)
46
  {
47
+ $this->container = $container;
48
+ $this->config = $container->make('config');
49
  }
50
 
51
  /**
58
  /**
59
  * Get a driver instance.
60
  *
61
+ * @param string|null $driver
62
  * @return mixed
63
+ *
64
+ * @throws \InvalidArgumentException
65
  */
66
  public function driver($driver = null)
67
  {
68
  $driver = $driver ?: $this->getDefaultDriver();
69
 
70
+ if (is_null($driver)) {
71
+ throw new InvalidArgumentException(sprintf(
72
+ 'Unable to resolve NULL driver for [%s].', static::class
73
+ ));
74
+ }
75
+
76
  // If the given driver has not been created before, we will create the instances
77
  // here and cache it so we can return it next time very quickly. If there is
78
  // already a driver created by this name, we'll just return that instance.
93
  */
94
  protected function createDriver($driver)
95
  {
96
+ // First, we will determine if a custom driver creator exists for the given driver and
97
+ // if it does not we will check for a creator method for the driver. Custom creator
98
+ // callbacks allow developers to build their own "drivers" easily using Closures.
99
  if (isset($this->customCreators[$driver])) {
100
  return $this->callCustomCreator($driver);
101
  } else {
105
  return $this->$method();
106
  }
107
  }
108
+
109
  throw new InvalidArgumentException("Driver [$driver] not supported.");
110
  }
111
 
117
  */
118
  protected function callCustomCreator($driver)
119
  {
120
+ return $this->customCreators[$driver]($this->container);
121
  }
122
 
123
  /**
124
  * Register a custom driver creator Closure.
125
  *
126
+ * @param string $driver
127
  * @param \Closure $callback
128
  * @return $this
129
  */
144
  return $this->drivers;
145
  }
146
 
147
+ /**
148
+ * Get the container instance used by the manager.
149
+ *
150
+ * @return \Illuminate\Contracts\Container\Container
151
+ */
152
+ public function getContainer()
153
+ {
154
+ return $this->container;
155
+ }
156
+
157
+ /**
158
+ * Set the container instance used by the manager.
159
+ *
160
+ * @param \Illuminate\Contracts\Container\Container $container
161
+ * @return $this
162
+ */
163
+ public function setContainer(Container $container)
164
+ {
165
+ $this->container = $container;
166
+
167
+ return $this;
168
+ }
169
+
170
+ /**
171
+ * Forget all of the resolved driver instances.
172
+ *
173
+ * @return $this
174
+ */
175
+ public function forgetDrivers()
176
+ {
177
+ $this->drivers = [];
178
+
179
+ return $this;
180
+ }
181
+
182
  /**
183
  * Dynamically call the default driver instance.
184
  *
185
  * @param string $method
186
+ * @param array $parameters
187
  * @return mixed
188
  */
189
  public function __call($method, $parameters)
vendor/illuminate/support/MessageBag.php CHANGED
@@ -3,11 +3,11 @@
3
  namespace Illuminate\Support;
4
 
5
  use Countable;
6
- use JsonSerializable;
7
- use Illuminate\Contracts\Support\Jsonable;
8
  use Illuminate\Contracts\Support\Arrayable;
9
- use Illuminate\Contracts\Support\MessageProvider;
10
  use Illuminate\Contracts\Support\MessageBag as MessageBagContract;
 
 
11
 
12
  class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, MessageBagContract, MessageProvider
13
  {
@@ -34,7 +34,9 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
34
  public function __construct(array $messages = [])
35
  {
36
  foreach ($messages as $key => $value) {
37
- $this->messages[$key] = (array) $value;
 
 
38
  }
39
  }
40
 
@@ -49,7 +51,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
49
  }
50
 
51
  /**
52
- * Add a message to the bag.
53
  *
54
  * @param string $key
55
  * @param string $message
@@ -64,6 +66,19 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
64
  return $this;
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  /**
68
  * Determine if a key and message combination already exists.
69
  *
@@ -79,7 +94,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
79
  }
80
 
81
  /**
82
- * Merge a new array of messages into the bag.
83
  *
84
  * @param \Illuminate\Contracts\Support\MessageProvider|array $messages
85
  * @return $this
@@ -98,11 +113,15 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
98
  /**
99
  * Determine if messages exist for all of the given keys.
100
  *
101
- * @param array|string $key
102
  * @return bool
103
  */
104
  public function has($key)
105
  {
 
 
 
 
106
  if (is_null($key)) {
107
  return $this->any();
108
  }
@@ -126,6 +145,10 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
126
  */
127
  public function hasAny($keys = [])
128
  {
 
 
 
 
129
  $keys = is_array($keys) ? $keys : func_get_args();
130
 
131
  foreach ($keys as $key) {
@@ -138,10 +161,10 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
138
  }
139
 
140
  /**
141
- * Get the first message from the bag for a given key.
142
  *
143
- * @param string $key
144
- * @param string $format
145
  * @return string
146
  */
147
  public function first($key = null, $format = null)
@@ -154,17 +177,17 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
154
  }
155
 
156
  /**
157
- * Get all of the messages from the bag for a given key.
158
  *
159
  * @param string $key
160
- * @param string $format
161
  * @return array
162
  */
163
  public function get($key, $format = null)
164
  {
165
- // If the message exists in the container, we will transform it and return
166
- // the message. Otherwise, we'll check if the key is implicit & collect
167
- // all the messages that match a given key and output it as an array.
168
  if (array_key_exists($key, $this->messages)) {
169
  return $this->transform(
170
  $this->messages[$key], $this->checkFormat($format), $key
@@ -199,9 +222,9 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
199
  }
200
 
201
  /**
202
- * Get all of the messages for every key in the bag.
203
  *
204
- * @param string $format
205
  * @return array
206
  */
207
  public function all($format = null)
@@ -218,9 +241,9 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
218
  }
219
 
220
  /**
221
- * Get all of the unique messages for every key in the bag.
222
  *
223
- * @param string $format
224
  * @return array
225
  */
226
  public function unique($format = null)
@@ -231,7 +254,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
231
  /**
232
  * Format an array of messages.
233
  *
234
- * @param array $messages
235
  * @param string $format
236
  * @param string $messageKey
237
  * @return array
@@ -259,7 +282,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
259
  }
260
 
261
  /**
262
- * Get the raw messages in the container.
263
  *
264
  * @return array
265
  */
@@ -269,7 +292,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
269
  }
270
 
271
  /**
272
- * Get the raw messages in the container.
273
  *
274
  * @return array
275
  */
@@ -321,6 +344,16 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
321
  return ! $this->any();
322
  }
323
 
 
 
 
 
 
 
 
 
 
 
324
  /**
325
  * Determine if the message bag has any messages.
326
  *
@@ -332,7 +365,7 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me
332
  }
333
 
334
  /**
335
- * Get the number of messages in the container.
336
  *
337
  * @return int
338
  */
3
  namespace Illuminate\Support;
4
 
5
  use Countable;
 
 
6
  use Illuminate\Contracts\Support\Arrayable;
7
+ use Illuminate\Contracts\Support\Jsonable;
8
  use Illuminate\Contracts\Support\MessageBag as MessageBagContract;
9
+ use Illuminate\Contracts\Support\MessageProvider;
10
+ use JsonSerializable;
11
 
12
  class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, MessageBagContract, MessageProvider
13
  {
34
  public function __construct(array $messages = [])
35
  {
36
  foreach ($messages as $key => $value) {
37
+ $value = $value instanceof Arrayable ? $value->toArray() : (array) $value;
38
+
39
+ $this->messages[$key] = array_unique($value);
40
  }
41
  }
42
 
51
  }
52
 
53
  /**
54
+ * Add a message to the message bag.
55
  *
56
  * @param string $key
57
  * @param string $message
66
  return $this;
67
  }
68
 
69
+ /**
70
+ * Add a message to the message bag if the given conditional is "true".
71
+ *
72
+ * @param bool $boolean
73
+ * @param string $key
74
+ * @param string $message
75
+ * @return $this
76
+ */
77
+ public function addIf($boolean, $key, $message)
78
+ {
79
+ return $boolean ? $this->add($key, $message) : $this;
80
+ }
81
+
82
  /**
83
  * Determine if a key and message combination already exists.
84
  *
94
  }
95
 
96
  /**
97
+ * Merge a new array of messages into the message bag.
98
  *
99
  * @param \Illuminate\Contracts\Support\MessageProvider|array $messages
100
  * @return $this
113
  /**
114
  * Determine if messages exist for all of the given keys.
115
  *
116
+ * @param array|string|null $key
117
  * @return bool
118
  */
119
  public function has($key)
120
  {
121
+ if ($this->isEmpty()) {
122
+ return false;
123
+ }
124
+
125
  if (is_null($key)) {
126
  return $this->any();
127
  }
145
  */
146
  public function hasAny($keys = [])
147
  {
148
+ if ($this->isEmpty()) {
149
+ return false;
150
+ }
151
+
152
  $keys = is_array($keys) ? $keys : func_get_args();
153
 
154
  foreach ($keys as $key) {
161
  }
162
 
163
  /**
164
+ * Get the first message from the message bag for a given key.
165
  *
166
+ * @param string|null $key
167
+ * @param string|null $format
168
  * @return string
169
  */
170
  public function first($key = null, $format = null)
177
  }
178
 
179
  /**
180
+ * Get all of the messages from the message bag for a given key.
181
  *
182
  * @param string $key
183
+ * @param string|null $format
184
  * @return array
185
  */
186
  public function get($key, $format = null)
187
  {
188
+ // If the message exists in the message bag, we will transform it and return
189
+ // the message. Otherwise, we will check if the key is implicit & collect
190
+ // all the messages that match the given key and output it as an array.
191
  if (array_key_exists($key, $this->messages)) {
192
  return $this->transform(
193
  $this->messages[$key], $this->checkFormat($format), $key
222
  }
223
 
224
  /**
225
+ * Get all of the messages for every key in the message bag.
226
  *
227
+ * @param string|null $format
228
  * @return array
229
  */
230
  public function all($format = null)
241
  }
242
 
243
  /**
244
+ * Get all of the unique messages for every key in the message bag.
245
  *
246
+ * @param string|null $format
247
  * @return array
248
  */
249
  public function unique($format = null)
254
  /**
255
  * Format an array of messages.
256
  *
257
+ * @param array $messages
258
  * @param string $format
259
  * @param string $messageKey
260
  * @return array
282
  }
283
 
284
  /**
285
+ * Get the raw messages in the message bag.
286
  *
287
  * @return array
288
  */
292
  }
293
 
294
  /**
295
+ * Get the raw messages in the message bag.
296
  *
297
  * @return array
298
  */
344
  return ! $this->any();
345
  }
346
 
347
+ /**
348
+ * Determine if the message bag has any messages.
349
+ *
350
+ * @return bool
351
+ */
352
+ public function isNotEmpty()
353
+ {
354
+ return $this->any();
355
+ }
356
+
357
  /**
358
  * Determine if the message bag has any messages.
359
  *
365
  }
366
 
367
  /**
368
+ * Get the number of messages in the message bag.
369
  *
370
  * @return int
371
  */
vendor/illuminate/support/NamespacedItemResolver.php CHANGED
@@ -56,18 +56,14 @@ class NamespacedItemResolver
56
  // just pulling an entire group out of the array and not a single item.
57
  $group = $segments[0];
58
 
59
- if (count($segments) == 1) {
60
- return [null, $group, null];
61
- }
62
-
63
  // If there is more than one segment in this group, it means we are pulling
64
  // a specific item out of a group and will need to return this item name
65
  // as well as the group so we know which item to pull from the arrays.
66
- else {
67
- $item = implode('.', array_slice($segments, 1));
 
68
 
69
- return [null, $group, $item];
70
- }
71
  }
72
 
73
  /**
@@ -78,7 +74,7 @@ class NamespacedItemResolver
78
  */
79
  protected function parseNamespacedSegments($key)
80
  {
81
- list($namespace, $item) = explode('::', $key);
82
 
83
  // First we'll just explode the first segment to get the namespace and group
84
  // since the item should be in the remaining segments. Once we have these
@@ -96,7 +92,7 @@ class NamespacedItemResolver
96
  * Set the parsed value of a key.
97
  *
98
  * @param string $key
99
- * @param array $parsed
100
  * @return void
101
  */
102
  public function setParsedKey($key, $parsed)
56
  // just pulling an entire group out of the array and not a single item.
57
  $group = $segments[0];
58
 
 
 
 
 
59
  // If there is more than one segment in this group, it means we are pulling
60
  // a specific item out of a group and will need to return this item name
61
  // as well as the group so we know which item to pull from the arrays.
62
+ $item = count($segments) === 1
63
+ ? null
64
+ : implode('.', array_slice($segments, 1));
65
 
66
+ return [null, $group, $item];
 
67
  }
68
 
69
  /**
74
  */
75
  protected function parseNamespacedSegments($key)
76
  {
77
+ [$namespace, $item] = explode('::', $key);
78
 
79
  // First we'll just explode the first segment to get the namespace and group
80
  // since the item should be in the remaining segments. Once we have these
92
  * Set the parsed value of a key.
93
  *
94
  * @param string $key
95
+ * @param array $parsed
96
  * @return void
97
  */
98
  public function setParsedKey($key, $parsed)
vendor/illuminate/support/Optional.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use ArrayAccess;
6
+ use ArrayObject;
7
+ use Illuminate\Support\Traits\Macroable;
8
+
9
+ class Optional implements ArrayAccess
10
+ {
11
+ use Macroable {
12
+ __call as macroCall;
13
+ }
14
+
15
+ /**
16
+ * The underlying object.
17
+ *
18
+ * @var mixed
19
+ */
20
+ protected $value;
21
+
22
+ /**
23
+ * Create a new optional instance.
24
+ *
25
+ * @param mixed $value
26
+ * @return void
27
+ */
28
+ public function __construct($value)
29
+ {
30
+ $this->value = $value;
31
+ }
32
+
33
+ /**
34
+ * Dynamically access a property on the underlying object.
35
+ *
36
+ * @param string $key
37
+ * @return mixed
38
+ */
39
+ public function __get($key)
40
+ {
41
+ if (is_object($this->value)) {
42
+ return $this->value->{$key} ?? null;
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Dynamically check a property exists on the underlying object.
48
+ *
49
+ * @param mixed $name
50
+ * @return bool
51
+ */
52
+ public function __isset($name)
53
+ {
54
+ if (is_object($this->value)) {
55
+ return isset($this->value->{$name});
56
+ }
57
+
58
+ if (is_array($this->value) || $this->value instanceof ArrayObject) {
59
+ return isset($this->value[$name]);
60
+ }
61
+
62
+ return false;
63
+ }
64
+
65
+ /**
66
+ * Determine if an item exists at an offset.
67
+ *
68
+ * @param mixed $key
69
+ * @return bool
70
+ */
71
+ public function offsetExists($key)
72
+ {
73
+ return Arr::accessible($this->value) && Arr::exists($this->value, $key);
74
+ }
75
+
76
+ /**
77
+ * Get an item at a given offset.
78
+ *
79
+ * @param mixed $key
80
+ * @return mixed
81
+ */
82
+ public function offsetGet($key)
83
+ {
84
+ return Arr::get($this->value, $key);
85
+ }
86
+
87
+ /**
88
+ * Set the item at a given offset.
89
+ *
90
+ * @param mixed $key
91
+ * @param mixed $value
92
+ * @return void
93
+ */
94
+ public function offsetSet($key, $value)
95
+ {
96
+ if (Arr::accessible($this->value)) {
97
+ $this->value[$key] = $value;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Unset the item at a given offset.
103
+ *
104
+ * @param string $key
105
+ * @return void
106
+ */
107
+ public function offsetUnset($key)
108
+ {
109
+ if (Arr::accessible($this->value)) {
110
+ unset($this->value[$key]);
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Dynamically pass a method to the underlying object.
116
+ *
117
+ * @param string $method
118
+ * @param array $parameters
119
+ * @return mixed
120
+ */
121
+ public function __call($method, $parameters)
122
+ {
123
+ if (static::hasMacro($method)) {
124
+ return $this->macroCall($method, $parameters);
125
+ }
126
+
127
+ if (is_object($this->value)) {
128
+ return $this->value->{$method}(...$parameters);
129
+ }
130
+ }
131
+ }
vendor/illuminate/support/Pluralizer.php CHANGED
@@ -2,18 +2,22 @@
2
 
3
  namespace Illuminate\Support;
4
 
5
- use Doctrine\Common\Inflector\Inflector;
 
 
 
6
 
7
  class Pluralizer
8
  {
9
  /**
10
  * Uncountable word forms.
11
  *
12
- * @var array
13
  */
14
  public static $uncountable = [
15
  'audio',
16
  'bison',
 
17
  'chassis',
18
  'compensation',
19
  'coreopsis',
@@ -24,11 +28,14 @@ class Pluralizer
24
  'equipment',
25
  'evidence',
26
  'feedback',
 
27
  'fish',
28
  'furniture',
29
  'gold',
 
30
  'information',
31
  'jedi',
 
32
  'knowledge',
33
  'love',
34
  'metadata',
@@ -41,9 +48,12 @@ class Pluralizer
41
  'pokemon',
42
  'police',
43
  'rain',
 
 
44
  'rice',
45
  'series',
46
  'sheep',
 
47
  'species',
48
  'swine',
49
  'traffic',
@@ -54,16 +64,16 @@ class Pluralizer
54
  * Get the plural form of an English word.
55
  *
56
  * @param string $value
57
- * @param int $count
58
  * @return string
59
  */
60
  public static function plural($value, $count = 2)
61
  {
62
- if ((int) $count === 1 || static::uncountable($value)) {
63
  return $value;
64
  }
65
 
66
- $plural = Inflector::pluralize($value);
67
 
68
  return static::matchCase($plural, $value);
69
  }
@@ -76,7 +86,7 @@ class Pluralizer
76
  */
77
  public static function singular($value)
78
  {
79
- $singular = Inflector::singularize($value);
80
 
81
  return static::matchCase($singular, $value);
82
  }
@@ -104,11 +114,34 @@ class Pluralizer
104
  $functions = ['mb_strtolower', 'mb_strtoupper', 'ucfirst', 'ucwords'];
105
 
106
  foreach ($functions as $function) {
107
- if (call_user_func($function, $comparison) === $comparison) {
108
- return call_user_func($function, $value);
109
  }
110
  }
111
 
112
  return $value;
113
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  }
2
 
3
  namespace Illuminate\Support;
4
 
5
+ use Doctrine\Inflector\CachedWordInflector;
6
+ use Doctrine\Inflector\Inflector;
7
+ use Doctrine\Inflector\Rules\English;
8
+ use Doctrine\Inflector\RulesetInflector;
9
 
10
  class Pluralizer
11
  {
12
  /**
13
  * Uncountable word forms.
14
  *
15
+ * @var string[]
16
  */
17
  public static $uncountable = [
18
  'audio',
19
  'bison',
20
+ 'cattle',
21
  'chassis',
22
  'compensation',
23
  'coreopsis',
28
  'equipment',
29
  'evidence',
30
  'feedback',
31
+ 'firmware',
32
  'fish',
33
  'furniture',
34
  'gold',
35
+ 'hardware',
36
  'information',
37
  'jedi',
38
+ 'kin',
39
  'knowledge',
40
  'love',
41
  'metadata',
48
  'pokemon',
49
  'police',
50
  'rain',
51
+ 'recommended',
52
+ 'related',
53
  'rice',
54
  'series',
55
  'sheep',
56
+ 'software',
57
  'species',
58
  'swine',
59
  'traffic',
64
  * Get the plural form of an English word.
65
  *
66
  * @param string $value
67
+ * @param int $count
68
  * @return string
69
  */
70
  public static function plural($value, $count = 2)
71
  {
72
+ if ((int) abs($count) === 1 || static::uncountable($value) || preg_match('/^(.*)[A-Za-z0-9\x{0080}-\x{FFFF}]$/u', $value) == 0) {
73
  return $value;
74
  }
75
 
76
+ $plural = static::inflector()->pluralize($value);
77
 
78
  return static::matchCase($plural, $value);
79
  }
86
  */
87
  public static function singular($value)
88
  {
89
+ $singular = static::inflector()->singularize($value);
90
 
91
  return static::matchCase($singular, $value);
92
  }
114
  $functions = ['mb_strtolower', 'mb_strtoupper', 'ucfirst', 'ucwords'];
115
 
116
  foreach ($functions as $function) {
117
+ if ($function($comparison) === $comparison) {
118
+ return $function($value);
119
  }
120
  }
121
 
122
  return $value;
123
  }
124
+
125
+ /**
126
+ * Get the inflector instance.
127
+ *
128
+ * @return \Doctrine\Inflector\Inflector
129
+ */
130
+ public static function inflector()
131
+ {
132
+ static $inflector;
133
+
134
+ if (is_null($inflector)) {
135
+ $inflector = new Inflector(
136
+ new CachedWordInflector(new RulesetInflector(
137
+ English\Rules::getSingularRuleset()
138
+ )),
139
+ new CachedWordInflector(new RulesetInflector(
140
+ English\Rules::getPluralRuleset()
141
+ ))
142
+ );
143
+ }
144
+
145
+ return $inflector;
146
+ }
147
  }
vendor/illuminate/support/ProcessUtils.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ /**
6
+ * ProcessUtils is a bunch of utility methods.
7
+ *
8
+ * This class was originally copied from Symfony 3.
9
+ */
10
+ class ProcessUtils
11
+ {
12
+ /**
13
+ * Escapes a string to be used as a shell argument.
14
+ *
15
+ * @param string $argument
16
+ * @return string
17
+ */
18
+ public static function escapeArgument($argument)
19
+ {
20
+ // Fix for PHP bug #43784 escapeshellarg removes % from given string
21
+ // Fix for PHP bug #49446 escapeshellarg doesn't work on Windows
22
+ // @see https://bugs.php.net/bug.php?id=43784
23
+ // @see https://bugs.php.net/bug.php?id=49446
24
+ if ('\\' === DIRECTORY_SEPARATOR) {
25
+ if ('' === $argument) {
26
+ return '""';
27
+ }
28
+
29
+ $escapedArgument = '';
30
+ $quote = false;
31
+
32
+ foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) {
33
+ if ('"' === $part) {
34
+ $escapedArgument .= '\\"';
35
+ } elseif (self::isSurroundedBy($part, '%')) {
36
+ // Avoid environment variable expansion
37
+ $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%';
38
+ } else {
39
+ // escape trailing backslash
40
+ if ('\\' === substr($part, -1)) {
41
+ $part .= '\\';
42
+ }
43
+ $quote = true;
44
+ $escapedArgument .= $part;
45
+ }
46
+ }
47
+
48
+ if ($quote) {
49
+ $escapedArgument = '"'.$escapedArgument.'"';
50
+ }
51
+
52
+ return $escapedArgument;
53
+ }
54
+
55
+ return "'".str_replace("'", "'\\''", $argument)."'";
56
+ }
57
+
58
+ /**
59
+ * Is the given string surrounded by the given character?
60
+ *
61
+ * @param string $arg
62
+ * @param string $char
63
+ * @return bool
64
+ */
65
+ protected static function isSurroundedBy($arg, $char)
66
+ {
67
+ return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1];
68
+ }
69
+ }
vendor/illuminate/support/Reflector.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use ReflectionClass;
6
+ use ReflectionMethod;
7
+ use ReflectionNamedType;
8
+
9
+ class Reflector
10
+ {
11
+ /**
12
+ * This is a PHP 7.4 compatible implementation of is_callable.
13
+ *
14
+ * @param mixed $var
15
+ * @param bool $syntaxOnly
16
+ * @return bool
17
+ */
18
+ public static function isCallable($var, $syntaxOnly = false)
19
+ {
20
+ if (! is_array($var)) {
21
+ return is_callable($var, $syntaxOnly);
22
+ }
23
+
24
+ if ((! isset($var[0]) || ! isset($var[1])) ||
25
+ ! is_string($var[1] ?? null)) {
26
+ return false;
27
+ }
28
+
29
+ if ($syntaxOnly &&
30
+ (is_string($var[0]) || is_object($var[0])) &&
31
+ is_string($var[1])) {
32
+ return true;
33
+ }
34
+
35
+ $class = is_object($var[0]) ? get_class($var[0]) : $var[0];
36
+
37
+ $method = $var[1];
38
+
39
+ if (! class_exists($class)) {
40
+ return false;
41
+ }
42
+
43
+ if (method_exists($class, $method)) {
44
+ return (new ReflectionMethod($class, $method))->isPublic();
45
+ }
46
+
47
+ if (is_object($var[0]) && method_exists($class, '__call')) {
48
+ return (new ReflectionMethod($class, '__call'))->isPublic();
49
+ }
50
+
51
+ if (! is_object($var[0]) && method_exists($class, '__callStatic')) {
52
+ return (new ReflectionMethod($class, '__callStatic'))->isPublic();
53
+ }
54
+
55
+ return false;
56
+ }
57
+
58
+ /**
59
+ * Get the class name of the given parameter's type, if possible.
60
+ *
61
+ * @param \ReflectionParameter $parameter
62
+ * @return string|null
63
+ */
64
+ public static function getParameterClassName($parameter)
65
+ {
66
+ $type = $parameter->getType();
67
+
68
+ if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) {
69
+ return;
70
+ }
71
+
72
+ $name = $type->getName();
73
+
74
+ if (! is_null($class = $parameter->getDeclaringClass())) {
75
+ if ($name === 'self') {
76
+ return $class->getName();
77
+ }
78
+
79
+ if ($name === 'parent' && $parent = $class->getParentClass()) {
80
+ return $parent->getName();
81
+ }
82
+ }
83
+
84
+ return $name;
85
+ }
86
+
87
+ /**
88
+ * Determine if the parameter's type is a subclass of the given type.
89
+ *
90
+ * @param \ReflectionParameter $parameter
91
+ * @param string $className
92
+ * @return bool
93
+ */
94
+ public static function isParameterSubclassOf($parameter, $className)
95
+ {
96
+ $paramClassName = static::getParameterClassName($parameter);
97
+
98
+ return ($paramClassName && class_exists($paramClassName))
99
+ ? (new ReflectionClass($paramClassName))->isSubclassOf($className)
100
+ : false;
101
+ }
102
+ }
vendor/illuminate/support/ServiceProvider.php CHANGED
@@ -2,7 +2,13 @@
2
 
3
  namespace Illuminate\Support;
4
 
 
5
  use Illuminate\Console\Application as Artisan;
 
 
 
 
 
6
 
7
  abstract class ServiceProvider
8
  {
@@ -14,30 +20,37 @@ abstract class ServiceProvider
14
  protected $app;
15
 
16
  /**
17
- * Indicates if loading of the provider is deferred.
18
  *
19
- * @var bool
 
 
 
 
 
 
 
20
  */
21
- protected $defer = false;
22
 
23
  /**
24
  * The paths that should be published.
25
  *
26
  * @var array
27
  */
28
- protected static $publishes = [];
29
 
30
  /**
31
  * The paths that should be published by group.
32
  *
33
  * @var array
34
  */
35
- protected static $publishGroups = [];
36
 
37
  /**
38
  * Create a new service provider instance.
39
  *
40
- * @param \Illuminate\Contracts\Foundation\Application $app
41
  * @return void
42
  */
43
  public function __construct($app)
@@ -45,6 +58,62 @@ abstract class ServiceProvider
45
  $this->app = $app;
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  /**
49
  * Merge the given configuration with the existing configuration.
50
  *
@@ -54,9 +123,13 @@ abstract class ServiceProvider
54
  */
55
  protected function mergeConfigFrom($path, $key)
56
  {
57
- $config = $this->app['config']->get($key, []);
 
58
 
59
- $this->app['config']->set($key, array_merge(require $path, $config));
 
 
 
60
  }
61
 
62
  /**
@@ -67,7 +140,7 @@ abstract class ServiceProvider
67
  */
68
  protected function loadRoutesFrom($path)
69
  {
70
- if (! $this->app->routesAreCached()) {
71
  require $path;
72
  }
73
  }
@@ -75,17 +148,40 @@ abstract class ServiceProvider
75
  /**
76
  * Register a view file namespace.
77
  *
78
- * @param string $path
79
  * @param string $namespace
80
  * @return void
81
  */
82
  protected function loadViewsFrom($path, $namespace)
83
  {
84
- if (is_dir($appPath = $this->app->resourcePath().'/views/vendor/'.$namespace)) {
85
- $this->app['view']->addNamespace($namespace, $appPath);
86
- }
 
 
 
 
 
 
87
 
88
- $this->app['view']->addNamespace($namespace, $path);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
 
91
  /**
@@ -97,38 +193,86 @@ abstract class ServiceProvider
97
  */
98
  protected function loadTranslationsFrom($path, $namespace)
99
  {
100
- $this->app['translator']->addNamespace($namespace, $path);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  }
102
 
103
  /**
104
- * Register a database migration path.
105
  *
106
  * @param array|string $paths
107
  * @return void
108
  */
109
  protected function loadMigrationsFrom($paths)
110
  {
111
- $this->app->afterResolving('migrator', function ($migrator) use ($paths) {
112
  foreach ((array) $paths as $path) {
113
  $migrator->path($path);
114
  }
115
  });
116
  }
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  /**
119
  * Register paths to be published by the publish command.
120
  *
121
  * @param array $paths
122
- * @param string $group
123
  * @return void
124
  */
125
- protected function publishes(array $paths, $group = null)
126
  {
127
  $this->ensurePublishArrayInitialized($class = static::class);
128
 
129
  static::$publishes[$class] = array_merge(static::$publishes[$class], $paths);
130
 
131
- if ($group) {
132
  $this->addPublishGroup($group, $paths);
133
  }
134
  }
@@ -167,8 +311,8 @@ abstract class ServiceProvider
167
  /**
168
  * Get the paths to publish.
169
  *
170
- * @param string $provider
171
- * @param string $group
172
  * @return array
173
  */
174
  public static function pathsToPublish($provider = null, $group = null)
@@ -218,6 +362,26 @@ abstract class ServiceProvider
218
  return [];
219
  }
220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  /**
222
  * Register the package's custom Artisan commands.
223
  *
@@ -260,18 +424,6 @@ abstract class ServiceProvider
260
  */
261
  public function isDeferred()
262
  {
263
- return $this->defer;
264
- }
265
-
266
- /**
267
- * Get a list of files that should be compiled for the package.
268
- *
269
- * @deprecated
270
- *
271
- * @return array
272
- */
273
- public static function compiles()
274
- {
275
- return [];
276
  }
277
  }
2
 
3
  namespace Illuminate\Support;
4
 
5
+ use Closure;
6
  use Illuminate\Console\Application as Artisan;
7
+ use Illuminate\Contracts\Foundation\CachesConfiguration;
8
+ use Illuminate\Contracts\Foundation\CachesRoutes;
9
+ use Illuminate\Contracts\Support\DeferrableProvider;
10
+ use Illuminate\Database\Eloquent\Factory as ModelFactory;
11
+ use Illuminate\View\Compilers\BladeCompiler;
12
 
13
  abstract class ServiceProvider
14
  {
20
  protected $app;
21
 
22
  /**
23
+ * All of the registered booting callbacks.
24
  *
25
+ * @var array
26
+ */
27
+ protected $bootingCallbacks = [];
28
+
29
+ /**
30
+ * All of the registered booted callbacks.
31
+ *
32
+ * @var array
33
  */
34
+ protected $bootedCallbacks = [];
35
 
36
  /**
37
  * The paths that should be published.
38
  *
39
  * @var array
40
  */
41
+ public static $publishes = [];
42
 
43
  /**
44
  * The paths that should be published by group.
45
  *
46
  * @var array
47
  */
48
+ public static $publishGroups = [];
49
 
50
  /**
51
  * Create a new service provider instance.
52
  *
53
+ * @param \Illuminate\Contracts\Foundation\Application $app
54
  * @return void
55
  */
56
  public function __construct($app)
58
  $this->app = $app;
59
  }
60
 
61
+ /**
62
+ * Register any application services.
63
+ *
64
+ * @return void
65
+ */
66
+ public function register()
67
+ {
68
+ //
69
+ }
70
+
71
+ /**
72
+ * Register a booting callback to be run before the "boot" method is called.
73
+ *
74
+ * @param \Closure $callback
75
+ * @return void
76
+ */
77
+ public function booting(Closure $callback)
78
+ {
79
+ $this->bootingCallbacks[] = $callback;
80
+ }
81
+
82
+ /**
83
+ * Register a booted callback to be run after the "boot" method is called.
84
+ *
85
+ * @param \Closure $callback
86
+ * @return void
87
+ */
88
+ public function booted(Closure $callback)
89
+ {
90
+ $this->bootedCallbacks[] = $callback;
91
+ }
92
+
93
+ /**
94
+ * Call the registered booting callbacks.
95
+ *
96
+ * @return void
97
+ */
98
+ public function callBootingCallbacks()
99
+ {
100
+ foreach ($this->bootingCallbacks as $callback) {
101
+ $this->app->call($callback);
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Call the registered booted callbacks.
107
+ *
108
+ * @return void
109
+ */
110
+ public function callBootedCallbacks()
111
+ {
112
+ foreach ($this->bootedCallbacks as $callback) {
113
+ $this->app->call($callback);
114
+ }
115
+ }
116
+
117
  /**
118
  * Merge the given configuration with the existing configuration.
119
  *
123
  */
124
  protected function mergeConfigFrom($path, $key)
125
  {
126
+ if (! ($this->app instanceof CachesConfiguration && $this->app->configurationIsCached())) {
127
+ $config = $this->app->make('config');
128
 
129
+ $config->set($key, array_merge(
130
+ require $path, $config->get($key, [])
131
+ ));
132
+ }
133
  }
134
 
135
  /**
140
  */
141
  protected function loadRoutesFrom($path)
142
  {
143
+ if (! ($this->app instanceof CachesRoutes && $this->app->routesAreCached())) {
144
  require $path;
145
  }
146
  }
148
  /**
149
  * Register a view file namespace.
150
  *
151
+ * @param string|array $path
152
  * @param string $namespace
153
  * @return void
154
  */
155
  protected function loadViewsFrom($path, $namespace)
156
  {
157
+ $this->callAfterResolving('view', function ($view) use ($path, $namespace) {
158
+ if (isset($this->app->config['view']['paths']) &&
159
+ is_array($this->app->config['view']['paths'])) {
160
+ foreach ($this->app->config['view']['paths'] as $viewPath) {
161
+ if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) {
162
+ $view->addNamespace($namespace, $appPath);
163
+ }
164
+ }
165
+ }
166
 
167
+ $view->addNamespace($namespace, $path);
168
+ });
169
+ }
170
+
171
+ /**
172
+ * Register the given view components with a custom prefix.
173
+ *
174
+ * @param string $prefix
175
+ * @param array $components
176
+ * @return void
177
+ */
178
+ protected function loadViewComponentsAs($prefix, array $components)
179
+ {
180
+ $this->callAfterResolving(BladeCompiler::class, function ($blade) use ($prefix, $components) {
181
+ foreach ($components as $alias => $component) {
182
+ $blade->component($component, is_string($alias) ? $alias : null, $prefix);
183
+ }
184
+ });
185
  }
186
 
187
  /**
193
  */
194
  protected function loadTranslationsFrom($path, $namespace)
195
  {
196
+ $this->callAfterResolving('translator', function ($translator) use ($path, $namespace) {
197
+ $translator->addNamespace($namespace, $path);
198
+ });
199
+ }
200
+
201
+ /**
202
+ * Register a JSON translation file path.
203
+ *
204
+ * @param string $path
205
+ * @return void
206
+ */
207
+ protected function loadJsonTranslationsFrom($path)
208
+ {
209
+ $this->callAfterResolving('translator', function ($translator) use ($path) {
210
+ $translator->addJsonPath($path);
211
+ });
212
  }
213
 
214
  /**
215
+ * Register database migration paths.
216
  *
217
  * @param array|string $paths
218
  * @return void
219
  */
220
  protected function loadMigrationsFrom($paths)
221
  {
222
+ $this->callAfterResolving('migrator', function ($migrator) use ($paths) {
223
  foreach ((array) $paths as $path) {
224
  $migrator->path($path);
225
  }
226
  });
227
  }
228
 
229
+ /**
230
+ * Register Eloquent model factory paths.
231
+ *
232
+ * @deprecated Will be removed in a future Laravel version.
233
+ *
234
+ * @param array|string $paths
235
+ * @return void
236
+ */
237
+ protected function loadFactoriesFrom($paths)
238
+ {
239
+ $this->callAfterResolving(ModelFactory::class, function ($factory) use ($paths) {
240
+ foreach ((array) $paths as $path) {
241
+ $factory->load($path);
242
+ }
243
+ });
244
+ }
245
+
246
+ /**
247
+ * Setup an after resolving listener, or fire immediately if already resolved.
248
+ *
249
+ * @param string $name
250
+ * @param callable $callback
251
+ * @return void
252
+ */
253
+ protected function callAfterResolving($name, $callback)
254
+ {
255
+ $this->app->afterResolving($name, $callback);
256
+
257
+ if ($this->app->resolved($name)) {
258
+ $callback($this->app->make($name), $this->app);
259
+ }
260
+ }
261
+
262
  /**
263
  * Register paths to be published by the publish command.
264
  *
265
  * @param array $paths
266
+ * @param mixed $groups
267
  * @return void
268
  */
269
+ protected function publishes(array $paths, $groups = null)
270
  {
271
  $this->ensurePublishArrayInitialized($class = static::class);
272
 
273
  static::$publishes[$class] = array_merge(static::$publishes[$class], $paths);
274
 
275
+ foreach ((array) $groups as $group) {
276
  $this->addPublishGroup($group, $paths);
277
  }
278
  }
311
  /**
312
  * Get the paths to publish.
313
  *
314
+ * @param string|null $provider
315
+ * @param string|null $group
316
  * @return array
317
  */
318
  public static function pathsToPublish($provider = null, $group = null)
362
  return [];
363
  }
364
 
365
+ /**
366
+ * Get the service providers available for publishing.
367
+ *
368
+ * @return array
369
+ */
370
+ public static function publishableProviders()
371
+ {
372
+ return array_keys(static::$publishes);
373
+ }
374
+
375
+ /**
376
+ * Get the groups available for publishing.
377
+ *
378
+ * @return array
379
+ */
380
+ public static function publishableGroups()
381
+ {
382
+ return array_keys(static::$publishGroups);
383
+ }
384
+
385
  /**
386
  * Register the package's custom Artisan commands.
387
  *
424
  */
425
  public function isDeferred()
426
  {
427
+ return $this instanceof DeferrableProvider;
 
 
 
 
 
 
 
 
 
 
 
 
428
  }
429
  }
vendor/illuminate/support/Str.php CHANGED
@@ -3,6 +3,12 @@
3
  namespace Illuminate\Support;
4
 
5
  use Illuminate\Support\Traits\Macroable;
 
 
 
 
 
 
6
 
7
  class Str
8
  {
@@ -30,7 +36,25 @@ class Str
30
  protected static $studlyCache = [];
31
 
32
  /**
33
- * Return the remainder of a string after a given value.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  *
35
  * @param string $subject
36
  * @param string $search
@@ -38,32 +62,98 @@ class Str
38
  */
39
  public static function after($subject, $search)
40
  {
41
- if ($search == '') {
 
 
 
 
 
 
 
 
 
 
 
 
42
  return $subject;
43
  }
44
 
45
- $pos = strpos($subject, $search);
46
 
47
- if ($pos === false) {
48
  return $subject;
49
  }
50
 
51
- return substr($subject, $pos + strlen($search));
52
  }
53
 
54
  /**
55
  * Transliterate a UTF-8 value to ASCII.
56
  *
57
  * @param string $value
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  * @return string
59
  */
60
- public static function ascii($value)
61
  {
62
- foreach (static::charsArray() as $key => $val) {
63
- $value = str_replace($val, $key, $value);
64
  }
65
 
66
- return preg_replace('/[^\x20-\x7E]/u', '', $value);
67
  }
68
 
69
  /**
@@ -85,13 +175,13 @@ class Str
85
  * Determine if a given string contains a given substring.
86
  *
87
  * @param string $haystack
88
- * @param string|array $needles
89
  * @return bool
90
  */
91
  public static function contains($haystack, $needles)
92
  {
93
  foreach ((array) $needles as $needle) {
94
- if ($needle != '' && mb_strpos($haystack, $needle) !== false) {
95
  return true;
96
  }
97
  }
@@ -99,17 +189,35 @@ class Str
99
  return false;
100
  }
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  /**
103
  * Determine if a given string ends with a given substring.
104
  *
105
  * @param string $haystack
106
- * @param string|array $needles
107
  * @return bool
108
  */
109
  public static function endsWith($haystack, $needles)
110
  {
111
  foreach ((array) $needles as $needle) {
112
- if (substr($haystack, -strlen($needle)) === (string) $needle) {
113
  return true;
114
  }
115
  }
@@ -134,24 +242,65 @@ class Str
134
  /**
135
  * Determine if a given string matches a given pattern.
136
  *
137
- * @param string $pattern
138
  * @param string $value
139
  * @return bool
140
  */
141
  public static function is($pattern, $value)
142
  {
143
- if ($pattern == $value) {
144
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  }
146
 
147
- $pattern = preg_quote($pattern, '#');
 
148
 
149
- // Asterisks are translated into zero-or-more regular expression wildcards
150
- // to make it convenient to check if the strings starts with the given
151
- // pattern such as "library/*", making any string check convenient.
152
- $pattern = str_replace('\*', '.*', $pattern);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
154
- return (bool) preg_match('#^'.$pattern.'\z#u', $value);
155
  }
156
 
157
  /**
@@ -169,7 +318,7 @@ class Str
169
  * Return the length of the given string.
170
  *
171
  * @param string $value
172
- * @param string $encoding
173
  * @return int
174
  */
175
  public static function length($value, $encoding = null)
@@ -185,7 +334,7 @@ class Str
185
  * Limit the number of characters in a string.
186
  *
187
  * @param string $value
188
- * @param int $limit
189
  * @param string $end
190
  * @return string
191
  */
@@ -213,7 +362,7 @@ class Str
213
  * Limit the number of words in a string.
214
  *
215
  * @param string $value
216
- * @param int $words
217
  * @param string $end
218
  * @return string
219
  */
@@ -229,11 +378,64 @@ class Str
229
  }
230
 
231
  /**
232
- * Parse a Class@method style callback into class and method.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  *
234
  * @param string $callback
235
  * @param string|null $default
236
- * @return array
237
  */
238
  public static function parseCallback($callback, $default = null)
239
  {
@@ -244,7 +446,7 @@ class Str
244
  * Get the plural form of an English word.
245
  *
246
  * @param string $value
247
- * @param int $count
248
  * @return string
249
  */
250
  public static function plural($value, $count = 2)
@@ -252,6 +454,22 @@ class Str
252
  return Pluralizer::plural($value, $count);
253
  }
254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  /**
256
  * Generate a more truly "random" alpha-numeric string.
257
  *
@@ -274,41 +492,36 @@ class Str
274
  }
275
 
276
  /**
277
- * Generate a "random" alpha-numeric string.
278
  *
279
- * Should not be considered sufficient for cryptography, etc.
280
- *
281
- * @deprecated since version 5.3. Use the "random" method directly.
282
- *
283
- * @param int $length
284
  * @return string
285
  */
286
- public static function quickRandom($length = 16)
287
  {
288
- if (PHP_MAJOR_VERSION > 5) {
289
- return static::random($length);
290
- }
291
-
292
- $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
293
-
294
- return substr(str_shuffle(str_repeat($pool, $length)), 0, $length);
295
  }
296
 
297
  /**
298
  * Replace a given value in the string sequentially with an array.
299
  *
300
  * @param string $search
301
- * @param array $replace
302
  * @param string $subject
303
  * @return string
304
  */
305
  public static function replaceArray($search, array $replace, $subject)
306
  {
307
- foreach ($replace as $value) {
308
- $subject = static::replaceFirst($search, $value, $subject);
 
 
 
 
309
  }
310
 
311
- return $subject;
312
  }
313
 
314
  /**
@@ -321,7 +534,7 @@ class Str
321
  */
322
  public static function replaceFirst($search, $replace, $subject)
323
  {
324
- if ($search == '') {
325
  return $subject;
326
  }
327
 
@@ -344,6 +557,10 @@ class Str
344
  */
345
  public static function replaceLast($search, $replace, $subject)
346
  {
 
 
 
 
347
  $position = strrpos($subject, $search);
348
 
349
  if ($position !== false) {
@@ -353,6 +570,23 @@ class Str
353
  return $subject;
354
  }
355
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  /**
357
  * Begin a string with a single instance of a given value.
358
  *
@@ -405,19 +639,23 @@ class Str
405
  *
406
  * @param string $title
407
  * @param string $separator
 
408
  * @return string
409
  */
410
- public static function slug($title, $separator = '-')
411
  {
412
- $title = static::ascii($title);
413
 
414
  // Convert all dashes/underscores into separator
415
- $flip = $separator == '-' ? '_' : '-';
416
 
417
  $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title);
418
 
 
 
 
419
  // Remove all characters that are not the separator, letters, numbers, or whitespace.
420
- $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($title));
421
 
422
  // Replace all separator characters and whitespace by a single separator
423
  $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title);
@@ -441,7 +679,7 @@ class Str
441
  }
442
 
443
  if (! ctype_lower($value)) {
444
- $value = preg_replace('/\s+/u', '', $value);
445
 
446
  $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));
447
  }
@@ -453,13 +691,13 @@ class Str
453
  * Determine if a given string starts with a given substring.
454
  *
455
  * @param string $haystack
456
- * @param string|array $needles
457
  * @return bool
458
  */
459
  public static function startsWith($haystack, $needles)
460
  {
461
  foreach ((array) $needles as $needle) {
462
- if ($needle != '' && substr($haystack, 0, strlen($needle)) === (string) $needle) {
463
  return true;
464
  }
465
  }
@@ -487,7 +725,7 @@ class Str
487
  }
488
 
489
  /**
490
- * Returns the portion of string specified by the start and length parameters.
491
  *
492
  * @param string $string
493
  * @param int $start
@@ -499,6 +737,24 @@ class Str
499
  return mb_substr($string, $start, $length, 'UTF-8');
500
  }
501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  /**
503
  * Make a string's first character uppercase.
504
  *
@@ -511,136 +767,60 @@ class Str
511
  }
512
 
513
  /**
514
- * Returns the replacements for the ascii method.
515
- *
516
- * Note: Adapted from Stringy\Stringy.
517
  *
518
- * @see https://github.com/danielstjules/Stringy/blob/2.3.1/LICENSE.txt
519
- *
520
- * @return array
521
  */
522
- protected static function charsArray()
523
  {
524
- static $charsArray;
 
 
 
525
 
526
- if (isset($charsArray)) {
527
- return $charsArray;
 
 
 
 
 
 
 
528
  }
529
 
530
- return $charsArray = [
531
- '0' => ['°', '₀', '۰'],
532
- '1' => ['¹', '₁', '۱'],
533
- '2' => ['²', '₂', '۲'],
534
- '3' => ['³', '₃', '۳'],
535
- '4' => ['⁴', '₄', '۴', '٤'],
536
- '5' => ['⁵', '₅', '۵', '٥'],
537
- '6' => ['⁶', '₆', '۶', '٦'],
538
- '7' => ['⁷', '₇', '۷'],
539
- '8' => ['⁸', '₈', '۸'],
540
- '9' => ['⁹', '₉', '۹'],
541
- 'a' => ['à', 'á', 'ả', 'ã', 'ạ', 'ă', 'ắ', 'ằ', 'ẳ', 'ẵ', 'ặ', 'â', 'ấ', 'ầ', 'ẩ', 'ẫ', 'ậ', 'ā', 'ą', 'å', 'α', 'ά', 'ἀ', 'ἁ', 'ἂ', 'ἃ', 'ἄ', 'ἅ', 'ἆ', 'ἇ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ὰ', 'ά', 'ᾰ', 'ᾱ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'а', 'أ', 'အ', 'ာ', 'ါ', 'ǻ', 'ǎ', 'ª', 'ა', 'अ', 'ا'],
542
- 'b' => ['б', 'β', 'Ъ', 'Ь', 'ب', 'ဗ', 'ბ'],
543
- 'c' => ['ç', 'ć', 'č', 'ĉ', 'ċ'],
544
- 'd' => ['ď', 'ð', 'đ', 'ƌ', 'ȡ', 'ɖ', 'ɗ', 'ᵭ', 'ᶁ', 'ᶑ', 'д', 'δ', 'د', 'ض', 'ဍ', 'ဒ', 'დ'],
545
- 'e' => ['é', 'è', 'ẻ', 'ẽ', 'ẹ', 'ê', 'ế', 'ề', 'ể', 'ễ', 'ệ', 'ë', 'ē', 'ę', 'ě', 'ĕ', 'ė', 'ε', 'έ', 'ἐ', 'ἑ', 'ἒ', 'ἓ', 'ἔ', 'ἕ', 'ὲ', 'έ', 'е', 'ё', 'э', 'є', 'ə', 'ဧ', 'ေ', 'ဲ', 'ე', 'ए', 'إ', 'ئ'],
546
- 'f' => ['ф', 'φ', 'ف', 'ƒ', 'ფ'],
547
- 'g' => ['ĝ', 'ğ', 'ġ', 'ģ', 'г', 'ґ', 'γ', 'ဂ', 'გ', 'گ'],
548
- 'h' => ['ĥ', 'ħ', 'η', 'ή', 'ح', 'ه', 'ဟ', 'ှ', 'ჰ'],
549
- 'i' => ['í', 'ì', 'ỉ', 'ĩ', 'ị', 'î', 'ï', 'ī', 'ĭ', 'į', 'ı', 'ι', 'ί', 'ϊ', 'ΐ', 'ἰ', 'ἱ', 'ἲ', 'ἳ', 'ἴ', 'ἵ', 'ἶ', 'ἷ', 'ὶ', 'ί', 'ῐ', 'ῑ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'і', 'ї', 'и', 'ဣ', 'ိ', 'ီ', 'ည်', 'ǐ', 'ი', 'इ'],
550
- 'j' => ['ĵ', 'ј', 'Ј', 'ჯ', 'ج'],
551
- 'k' => ['ķ', 'ĸ', 'к', 'κ', 'Ķ', 'ق', 'ك', 'က', 'კ', 'ქ', 'ک'],
552
- 'l' => ['ł', 'ľ', 'ĺ', 'ļ', 'ŀ', 'л', 'λ', 'ل', 'လ', 'ლ'],
553
- 'm' => ['м', 'μ', 'م', 'မ', 'მ'],
554
- 'n' => ['ñ', 'ń', 'ň', 'ņ', 'ʼn', 'ŋ', 'ν', 'н', 'ن', 'န', 'ნ'],
555
- 'o' => ['ó', 'ò', 'ỏ', 'õ', 'ọ', 'ô', 'ố', 'ồ', 'ổ', 'ỗ', 'ộ', 'ơ', 'ớ', 'ờ', 'ở', 'ỡ', 'ợ', 'ø', 'ō', 'ő', 'ŏ', 'ο', 'ὀ', 'ὁ', 'ὂ', 'ὃ', 'ὄ', 'ὅ', 'ὸ', 'ό', 'о', 'و', 'θ', 'ို', 'ǒ', 'ǿ', 'º', 'ო', 'ओ'],
556
- 'p' => ['п', 'π', 'ပ', 'პ', 'پ'],
557
- 'q' => ['ყ'],
558
- 'r' => ['ŕ', 'ř', 'ŗ', 'р', 'ρ', 'ر', 'რ'],
559
- 's' => ['ś', 'š', 'ş', 'с', 'σ', 'ș', 'ς', 'س', 'ص', 'စ', 'ſ', 'ს'],
560
- 't' => ['ť', 'ţ', 'т', 'τ', 'ț', 'ت', 'ط', 'ဋ', 'တ', 'ŧ', 'თ', 'ტ'],
561
- 'u' => ['ú', 'ù', 'ủ', 'ũ', 'ụ', 'ư', 'ứ', 'ừ', 'ử', 'ữ', 'ự', 'û', 'ū', 'ů', 'ű', 'ŭ', 'ų', 'µ', 'у', 'ဉ', 'ု', 'ူ', 'ǔ', 'ǖ', 'ǘ', 'ǚ', 'ǜ', 'უ', 'उ'],
562
- 'v' => ['в', 'ვ', 'ϐ'],
563
- 'w' => ['ŵ', 'ω', 'ώ', 'ဝ', 'ွ'],
564
- 'x' => ['χ', 'ξ'],
565
- 'y' => ['ý', 'ỳ', 'ỷ', 'ỹ', 'ỵ', 'ÿ', 'ŷ', 'й', 'ы', 'υ', 'ϋ', 'ύ', 'ΰ', 'ي', 'ယ'],
566
- 'z' => ['ź', 'ž', 'ż', 'з', 'ζ', 'ز', 'ဇ', 'ზ'],
567
- 'aa' => ['ع', 'आ', 'آ'],
568
- 'ae' => ['ä', 'æ', 'ǽ'],
569
- 'ai' => ['ऐ'],
570
- 'at' => ['@'],
571
- 'ch' => ['ч', 'ჩ', 'ჭ', 'چ'],
572
- 'dj' => ['ђ', 'đ'],
573
- 'dz' => ['џ', 'ძ'],
574
- 'ei' => ['ऍ'],
575
- 'gh' => ['غ', 'ღ'],
576
- 'ii' => ['ई'],
577
- 'ij' => ['ij'],
578
- 'kh' => ['х', 'خ', 'ხ'],
579
- 'lj' => ['љ'],
580
- 'nj' => ['њ'],
581
- 'oe' => ['ö', 'œ', 'ؤ'],
582
- 'oi' => ['ऑ'],
583
- 'oii' => ['ऒ'],
584
- 'ps' => ['ψ'],
585
- 'sh' => ['ш', 'შ', 'ش'],
586
- 'shch' => ['щ'],
587
- 'ss' => ['ß'],
588
- 'sx' => ['ŝ'],
589
- 'th' => ['þ', 'ϑ', 'ث', 'ذ', 'ظ'],
590
- 'ts' => ['ц', 'ც', 'წ'],
591
- 'ue' => ['ü'],
592
- 'uu' => ['ऊ'],
593
- 'ya' => ['я'],
594
- 'yu' => ['ю'],
595
- 'zh' => ['ж', 'ჟ', 'ژ'],
596
- '(c)' => ['©'],
597
- 'A' => ['Á', 'À', 'Ả', 'Ã', 'Ạ', 'Ă', 'Ắ', 'Ằ', 'Ẳ', 'Ẵ', 'Ặ', 'Â', 'Ấ', 'Ầ', 'Ẩ', 'Ẫ', 'Ậ', 'Å', 'Ā', 'Ą', 'Α', 'Ά', 'Ἀ', 'Ἁ', 'Ἂ', 'Ἃ', 'Ἄ', 'Ἅ', 'Ἆ', 'Ἇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'Ᾰ', 'Ᾱ', 'Ὰ', 'Ά', 'ᾼ', 'А', 'Ǻ', 'Ǎ'],
598
- 'B' => ['Б', 'Β', 'ब'],
599
- 'C' => ['Ç', 'Ć', 'Č', 'Ĉ', 'Ċ'],
600
- 'D' => ['Ď', 'Ð', 'Đ', 'Ɖ', 'Ɗ', 'Ƌ', 'ᴅ', 'ᴆ', 'Д', 'Δ'],
601
- 'E' => ['É', 'È', 'Ẻ', 'Ẽ', 'Ẹ', 'Ê', 'Ế', 'Ề', 'Ể', 'Ễ', 'Ệ', 'Ë', 'Ē', 'Ę', 'Ě', 'Ĕ', 'Ė', 'Ε', 'Έ', 'Ἐ', 'Ἑ', 'Ἒ', 'Ἓ', 'Ἔ', 'Ἕ', 'Έ', 'Ὲ', 'Е', 'Ё', 'Э', 'Є', 'Ə'],
602
- 'F' => ['Ф', 'Φ'],
603
- 'G' => ['Ğ', 'Ġ', 'Ģ', 'Г', 'Ґ', 'Γ'],
604
- 'H' => ['Η', 'Ή', 'Ħ'],
605
- 'I' => ['Í', 'Ì', 'Ỉ', 'Ĩ', 'Ị', 'Î', 'Ï', 'Ī', 'Ĭ', 'Į', 'İ', 'Ι', 'Ί', 'Ϊ', 'Ἰ', 'Ἱ', 'Ἳ', 'Ἴ', 'Ἵ', 'Ἶ', 'Ἷ', 'Ῐ', 'Ῑ', 'Ὶ', 'Ί', 'И', 'І', 'Ї', 'Ǐ', 'ϒ'],
606
- 'K' => ['К', 'Κ'],
607
- 'L' => ['Ĺ', 'Ł', 'Л', 'Λ', 'Ļ', 'Ľ', 'Ŀ', 'ल'],
608
- 'M' => ['М', 'Μ'],
609
- 'N' => ['Ń', 'Ñ', 'Ň', 'Ņ', 'Ŋ', 'Н', 'Ν'],
610
- 'O' => ['Ó', 'Ò', 'Ỏ', 'Õ', 'Ọ', 'Ô', 'Ố', 'Ồ', 'Ổ', 'Ỗ', 'Ộ', 'Ơ', 'Ớ', 'Ờ', 'Ở', 'Ỡ', 'Ợ', 'Ø', 'Ō', 'Ő', 'Ŏ', 'Ο', 'Ό', 'Ὀ', 'Ὁ', 'Ὂ', 'Ὃ', 'Ὄ', 'Ὅ', 'Ὸ', 'Ό', 'О', 'Θ', 'Ө', 'Ǒ', 'Ǿ'],
611
- 'P' => ['П', 'Π'],
612
- 'R' => ['Ř', 'Ŕ', 'Р', 'Ρ', 'Ŗ'],
613
- 'S' => ['Ş', 'Ŝ', 'Ș', 'Š', 'Ś', 'С', 'Σ'],
614
- 'T' => ['Ť', 'Ţ', 'Ŧ', 'Ț', 'Т', 'Τ'],
615
- 'U' => ['Ú', 'Ù', 'Ủ', 'Ũ', 'Ụ', 'Ư', 'Ứ', 'Ừ', 'Ử', 'Ữ', 'Ự', 'Û', 'Ū', 'Ů', 'Ű', 'Ŭ', 'Ų', 'У', 'Ǔ', 'Ǖ', 'Ǘ', 'Ǚ', 'Ǜ'],
616
- 'V' => ['В'],
617
- 'W' => ['Ω', 'Ώ', 'Ŵ'],
618
- 'X' => ['Χ', 'Ξ'],
619
- 'Y' => ['Ý', 'Ỳ', 'Ỷ', 'Ỹ', 'Ỵ', 'Ÿ', 'Ῠ', 'Ῡ', 'Ὺ', 'Ύ', 'Ы', 'Й', 'Υ', 'Ϋ', 'Ŷ'],
620
- 'Z' => ['Ź', 'Ž', 'Ż', 'З', 'Ζ'],
621
- 'AE' => ['Ä', 'Æ', 'Ǽ'],
622
- 'CH' => ['Ч'],
623
- 'DJ' => ['Ђ'],
624
- 'DZ' => ['Џ'],
625
- 'GX' => ['Ĝ'],
626
- 'HX' => ['Ĥ'],
627
- 'IJ' => ['IJ'],
628
- 'JX' => ['Ĵ'],
629
- 'KH' => ['Х'],
630
- 'LJ' => ['Љ'],
631
- 'NJ' => ['Њ'],
632
- 'OE' => ['Ö', 'Œ'],
633
- 'PS' => ['Ψ'],
634
- 'SH' => ['Ш'],
635
- 'SHCH' => ['Щ'],
636
- 'SS' => ['ẞ'],
637
- 'TH' => ['Þ'],
638
- 'TS' => ['Ц'],
639
- 'UE' => ['Ü'],
640
- 'YA' => ['Я'],
641
- 'YU' => ['Ю'],
642
- 'ZH' => ['Ж'],
643
- ' ' => ["\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"],
644
- ];
645
  }
646
  }
3
  namespace Illuminate\Support;
4
 
5
  use Illuminate\Support\Traits\Macroable;
6
+ use League\CommonMark\GithubFlavoredMarkdownConverter;
7
+ use Ramsey\Uuid\Codec\TimestampFirstCombCodec;
8
+ use Ramsey\Uuid\Generator\CombGenerator;
9
+ use Ramsey\Uuid\Uuid;
10
+ use Ramsey\Uuid\UuidFactory;
11
+ use voku\helper\ASCII;
12
 
13
  class Str
14
  {
36
  protected static $studlyCache = [];
37
 
38
  /**
39
+ * The callback that should be used to generate UUIDs.
40
+ *
41
+ * @var callable
42
+ */
43
+ protected static $uuidFactory;
44
+
45
+ /**
46
+ * Get a new stringable object from the given string.
47
+ *
48
+ * @param string $string
49
+ * @return \Illuminate\Support\Stringable
50
+ */
51
+ public static function of($string)
52
+ {
53
+ return new Stringable($string);
54
+ }
55
+
56
+ /**
57
+ * Return the remainder of a string after the first occurrence of a given value.
58
  *
59
  * @param string $subject
60
  * @param string $search
62
  */
63
  public static function after($subject, $search)
64
  {
65
+ return $search === '' ? $subject : array_reverse(explode($search, $subject, 2))[0];
66
+ }
67
+
68
+ /**
69
+ * Return the remainder of a string after the last occurrence of a given value.
70
+ *
71
+ * @param string $subject
72
+ * @param string $search
73
+ * @return string
74
+ */
75
+ public static function afterLast($subject, $search)
76
+ {
77
+ if ($search === '') {
78
  return $subject;
79
  }
80
 
81
+ $position = strrpos($subject, (string) $search);
82
 
83
+ if ($position === false) {
84
  return $subject;
85
  }
86
 
87
+ return substr($subject, $position + strlen($search));
88
  }
89
 
90
  /**
91
  * Transliterate a UTF-8 value to ASCII.
92
  *
93
  * @param string $value
94
+ * @param string $language
95
+ * @return string
96
+ */
97
+ public static function ascii($value, $language = 'en')
98
+ {
99
+ return ASCII::to_ascii((string) $value, $language);
100
+ }
101
+
102
+ /**
103
+ * Get the portion of a string before the first occurrence of a given value.
104
+ *
105
+ * @param string $subject
106
+ * @param string $search
107
+ * @return string
108
+ */
109
+ public static function before($subject, $search)
110
+ {
111
+ if ($search === '') {
112
+ return $subject;
113
+ }
114
+
115
+ $result = strstr($subject, (string) $search, true);
116
+
117
+ return $result === false ? $subject : $result;
118
+ }
119
+
120
+ /**
121
+ * Get the portion of a string before the last occurrence of a given value.
122
+ *
123
+ * @param string $subject
124
+ * @param string $search
125
+ * @return string
126
+ */
127
+ public static function beforeLast($subject, $search)
128
+ {
129
+ if ($search === '') {
130
+ return $subject;
131
+ }
132
+
133
+ $pos = mb_strrpos($subject, $search);
134
+
135
+ if ($pos === false) {
136
+ return $subject;
137
+ }
138
+
139
+ return static::substr($subject, 0, $pos);
140
+ }
141
+
142
+ /**
143
+ * Get the portion of a string between two given values.
144
+ *
145
+ * @param string $subject
146
+ * @param string $from
147
+ * @param string $to
148
  * @return string
149
  */
150
+ public static function between($subject, $from, $to)
151
  {
152
+ if ($from === '' || $to === '') {
153
+ return $subject;
154
  }
155
 
156
+ return static::beforeLast(static::after($subject, $from), $to);
157
  }
158
 
159
  /**
175
  * Determine if a given string contains a given substring.
176
  *
177
  * @param string $haystack
178
+ * @param string|string[] $needles
179
  * @return bool
180
  */
181
  public static function contains($haystack, $needles)
182
  {
183
  foreach ((array) $needles as $needle) {
184
+ if ($needle !== '' && mb_strpos($haystack, $needle) !== false) {
185
  return true;
186
  }
187
  }
189
  return false;
190
  }
191
 
192
+ /**
193
+ * Determine if a given string contains all array values.
194
+ *
195
+ * @param string $haystack
196
+ * @param string[] $needles
197
+ * @return bool
198
+ */
199
+ public static function containsAll($haystack, array $needles)
200
+ {
201
+ foreach ($needles as $needle) {
202
+ if (! static::contains($haystack, $needle)) {
203
+ return false;
204
+ }
205
+ }
206
+
207
+ return true;
208
+ }
209
+
210
  /**
211
  * Determine if a given string ends with a given substring.
212
  *
213
  * @param string $haystack
214
+ * @param string|string[] $needles
215
  * @return bool
216
  */
217
  public static function endsWith($haystack, $needles)
218
  {
219
  foreach ((array) $needles as $needle) {
220
+ if ($needle !== '' && substr($haystack, -strlen($needle)) === (string) $needle) {
221
  return true;
222
  }
223
  }
242
  /**
243
  * Determine if a given string matches a given pattern.
244
  *
245
+ * @param string|array $pattern
246
  * @param string $value
247
  * @return bool
248
  */
249
  public static function is($pattern, $value)
250
  {
251
+ $patterns = Arr::wrap($pattern);
252
+
253
+ if (empty($patterns)) {
254
+ return false;
255
+ }
256
+
257
+ foreach ($patterns as $pattern) {
258
+ // If the given value is an exact match we can of course return true right
259
+ // from the beginning. Otherwise, we will translate asterisks and do an
260
+ // actual pattern match against the two strings to see if they match.
261
+ if ($pattern == $value) {
262
+ return true;
263
+ }
264
+
265
+ $pattern = preg_quote($pattern, '#');
266
+
267
+ // Asterisks are translated into zero-or-more regular expression wildcards
268
+ // to make it convenient to check if the strings starts with the given
269
+ // pattern such as "library/*", making any string check convenient.
270
+ $pattern = str_replace('\*', '.*', $pattern);
271
+
272
+ if (preg_match('#^'.$pattern.'\z#u', $value) === 1) {
273
+ return true;
274
+ }
275
  }
276
 
277
+ return false;
278
+ }
279
 
280
+ /**
281
+ * Determine if a given string is 7 bit ASCII.
282
+ *
283
+ * @param string $value
284
+ * @return bool
285
+ */
286
+ public static function isAscii($value)
287
+ {
288
+ return ASCII::is_ascii((string) $value);
289
+ }
290
+
291
+ /**
292
+ * Determine if a given string is a valid UUID.
293
+ *
294
+ * @param string $value
295
+ * @return bool
296
+ */
297
+ public static function isUuid($value)
298
+ {
299
+ if (! is_string($value)) {
300
+ return false;
301
+ }
302
 
303
+ return preg_match('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD', $value) > 0;
304
  }
305
 
306
  /**
318
  * Return the length of the given string.
319
  *
320
  * @param string $value
321
+ * @param string|null $encoding
322
  * @return int
323
  */
324
  public static function length($value, $encoding = null)
334
  * Limit the number of characters in a string.
335
  *
336
  * @param string $value
337
+ * @param int $limit
338
  * @param string $end
339
  * @return string
340
  */
362
  * Limit the number of words in a string.
363
  *
364
  * @param string $value
365
+ * @param int $words
366
  * @param string $end
367
  * @return string
368
  */
378
  }
379
 
380
  /**
381
+ * Converts GitHub flavored Markdown into HTML.
382
+ *
383
+ * @param string $string
384
+ * @param array $options
385
+ * @return string
386
+ */
387
+ public static function markdown($string, array $options = [])
388
+ {
389
+ $converter = new GithubFlavoredMarkdownConverter($options);
390
+
391
+ return $converter->convertToHtml($string);
392
+ }
393
+
394
+ /**
395
+ * Pad both sides of a string with another.
396
+ *
397
+ * @param string $value
398
+ * @param int $length
399
+ * @param string $pad
400
+ * @return string
401
+ */
402
+ public static function padBoth($value, $length, $pad = ' ')
403
+ {
404
+ return str_pad($value, $length, $pad, STR_PAD_BOTH);
405
+ }
406
+
407
+ /**
408
+ * Pad the left side of a string with another.
409
+ *
410
+ * @param string $value
411
+ * @param int $length
412
+ * @param string $pad
413
+ * @return string
414
+ */
415
+ public static function padLeft($value, $length, $pad = ' ')
416
+ {
417
+ return str_pad($value, $length, $pad, STR_PAD_LEFT);
418
+ }
419
+
420
+ /**
421
+ * Pad the right side of a string with another.
422
+ *
423
+ * @param string $value
424
+ * @param int $length
425
+ * @param string $pad
426
+ * @return string
427
+ */
428
+ public static function padRight($value, $length, $pad = ' ')
429
+ {
430
+ return str_pad($value, $length, $pad, STR_PAD_RIGHT);
431
+ }
432
+
433
+ /**
434
+ * Parse a Class[@]method style callback into class and method.
435
  *
436
  * @param string $callback
437
  * @param string|null $default
438
+ * @return array<int, string|null>
439
  */
440
  public static function parseCallback($callback, $default = null)
441
  {
446
  * Get the plural form of an English word.
447
  *
448
  * @param string $value
449
+ * @param int $count
450
  * @return string
451
  */
452
  public static function plural($value, $count = 2)
454
  return Pluralizer::plural($value, $count);
455
  }
456
 
457
+ /**
458
+ * Pluralize the last word of an English, studly caps case string.
459
+ *
460
+ * @param string $value
461
+ * @param int $count
462
+ * @return string
463
+ */
464
+ public static function pluralStudly($value, $count = 2)
465
+ {
466
+ $parts = preg_split('/(.)(?=[A-Z])/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE);
467
+
468
+ $lastWord = array_pop($parts);
469
+
470
+ return implode('', $parts).self::plural($lastWord, $count);
471
+ }
472
+
473
  /**
474
  * Generate a more truly "random" alpha-numeric string.
475
  *
492
  }
493
 
494
  /**
495
+ * Repeat the given string.
496
  *
497
+ * @param string $string
498
+ * @param int $times
 
 
 
499
  * @return string
500
  */
501
+ public static function repeat(string $string, int $times)
502
  {
503
+ return str_repeat($string, $times);
 
 
 
 
 
 
504
  }
505
 
506
  /**
507
  * Replace a given value in the string sequentially with an array.
508
  *
509
  * @param string $search
510
+ * @param array<int|string, string> $replace
511
  * @param string $subject
512
  * @return string
513
  */
514
  public static function replaceArray($search, array $replace, $subject)
515
  {
516
+ $segments = explode($search, $subject);
517
+
518
+ $result = array_shift($segments);
519
+
520
+ foreach ($segments as $segment) {
521
+ $result .= (array_shift($replace) ?? $search).$segment;
522
  }
523
 
524
+ return $result;
525
  }
526
 
527
  /**
534
  */
535
  public static function replaceFirst($search, $replace, $subject)
536
  {
537
+ if ($search === '') {
538
  return $subject;
539
  }
540
 
557
  */
558
  public static function replaceLast($search, $replace, $subject)
559
  {
560
+ if ($search === '') {
561
+ return $subject;
562
+ }
563
+
564
  $position = strrpos($subject, $search);
565
 
566
  if ($position !== false) {
570
  return $subject;
571
  }
572
 
573
+ /**
574
+ * Remove any occurrence of the given string in the subject.
575
+ *
576
+ * @param string|array<string> $search
577
+ * @param string $subject
578
+ * @param bool $caseSensitive
579
+ * @return string
580
+ */
581
+ public static function remove($search, $subject, $caseSensitive = true)
582
+ {
583
+ $subject = $caseSensitive
584
+ ? str_replace($search, '', $subject)
585
+ : str_ireplace($search, '', $subject);
586
+
587
+ return $subject;
588
+ }
589
+
590
  /**
591
  * Begin a string with a single instance of a given value.
592
  *
639
  *
640
  * @param string $title
641
  * @param string $separator
642
+ * @param string|null $language
643
  * @return string
644
  */
645
+ public static function slug($title, $separator = '-', $language = 'en')
646
  {
647
+ $title = $language ? static::ascii($title, $language) : $title;
648
 
649
  // Convert all dashes/underscores into separator
650
+ $flip = $separator === '-' ? '_' : '-';
651
 
652
  $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title);
653
 
654
+ // Replace @ with the word 'at'
655
+ $title = str_replace('@', $separator.'at'.$separator, $title);
656
+
657
  // Remove all characters that are not the separator, letters, numbers, or whitespace.
658
+ $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', static::lower($title));
659
 
660
  // Replace all separator characters and whitespace by a single separator
661
  $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title);
679
  }
680
 
681
  if (! ctype_lower($value)) {
682
+ $value = preg_replace('/\s+/u', '', ucwords($value));
683
 
684
  $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));
685
  }
691
  * Determine if a given string starts with a given substring.
692
  *
693
  * @param string $haystack
694
+ * @param string|string[] $needles
695
  * @return bool
696
  */
697
  public static function startsWith($haystack, $needles)
698
  {
699
  foreach ((array) $needles as $needle) {
700
+ if ((string) $needle !== '' && strncmp($haystack, $needle, strlen($needle)) === 0) {
701
  return true;
702
  }
703
  }
725
  }
726
 
727
  /**
728
+ * Returns the portion of the string specified by the start and length parameters.
729
  *
730
  * @param string $string
731
  * @param int $start
737
  return mb_substr($string, $start, $length, 'UTF-8');
738
  }
739
 
740
+ /**
741
+ * Returns the number of substring occurrences.
742
+ *
743
+ * @param string $haystack
744
+ * @param string $needle
745
+ * @param int $offset
746
+ * @param int|null $length
747
+ * @return int
748
+ */
749
+ public static function substrCount($haystack, $needle, $offset = 0, $length = null)
750
+ {
751
+ if (! is_null($length)) {
752
+ return substr_count($haystack, $needle, $offset, $length);
753
+ } else {
754
+ return substr_count($haystack, $needle, $offset);
755
+ }
756
+ }
757
+
758
  /**
759
  * Make a string's first character uppercase.
760
  *
767
  }
768
 
769
  /**
770
+ * Generate a UUID (version 4).
 
 
771
  *
772
+ * @return \Ramsey\Uuid\UuidInterface
 
 
773
  */
774
+ public static function uuid()
775
  {
776
+ return static::$uuidFactory
777
+ ? call_user_func(static::$uuidFactory)
778
+ : Uuid::uuid4();
779
+ }
780
 
781
+ /**
782
+ * Generate a time-ordered UUID (version 4).
783
+ *
784
+ * @return \Ramsey\Uuid\UuidInterface
785
+ */
786
+ public static function orderedUuid()
787
+ {
788
+ if (static::$uuidFactory) {
789
+ return call_user_func(static::$uuidFactory);
790
  }
791
 
792
+ $factory = new UuidFactory;
793
+
794
+ $factory->setRandomGenerator(new CombGenerator(
795
+ $factory->getRandomGenerator(),
796
+ $factory->getNumberConverter()
797
+ ));
798
+
799
+ $factory->setCodec(new TimestampFirstCombCodec(
800
+ $factory->getUuidBuilder()
801
+ ));
802
+
803
+ return $factory->uuid4();
804
+ }
805
+
806
+ /**
807
+ * Set the callable that will be used to generate UUIDs.
808
+ *
809
+ * @param callable|null $factory
810
+ * @return void
811
+ */
812
+ public static function createUuidsUsing(callable $factory = null)
813
+ {
814
+ static::$uuidFactory = $factory;
815
+ }
816
+
817
+ /**
818
+ * Indicate that UUIDs should be created normally and not using a custom factory.
819
+ *
820
+ * @return void
821
+ */
822
+ public static function createUuidsNormally()
823
+ {
824
+ static::$uuidFactory = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
825
  }
826
  }
vendor/illuminate/support/Stringable.php ADDED
@@ -0,0 +1,813 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support;
4
+
5
+ use Closure;
6
+ use Illuminate\Support\Traits\Macroable;
7
+ use Illuminate\Support\Traits\Tappable;
8
+ use JsonSerializable;
9
+ use Symfony\Component\VarDumper\VarDumper;
10
+
11
+ class Stringable implements JsonSerializable
12
+ {
13
+ use Macroable, Tappable;
14
+
15
+ /**
16
+ * The underlying string value.
17
+ *
18
+ * @var string
19
+ */
20
+ protected $value;
21
+
22
+ /**
23
+ * Create a new instance of the class.
24
+ *
25
+ * @param string $value
26
+ * @return void
27
+ */
28
+ public function __construct($value = '')
29
+ {
30
+ $this->value = (string) $value;
31
+ }
32
+
33
+ /**
34
+ * Return the remainder of a string after the first occurrence of a given value.
35
+ *
36
+ * @param string $search
37
+ * @return static
38
+ */
39
+ public function after($search)
40
+ {
41
+ return new static(Str::after($this->value, $search));
42
+ }
43
+
44
+ /**
45
+ * Return the remainder of a string after the last occurrence of a given value.
46
+ *
47
+ * @param string $search
48
+ * @return static
49
+ */
50
+ public function afterLast($search)
51
+ {
52
+ return new static(Str::afterLast($this->value, $search));
53
+ }
54
+
55
+ /**
56
+ * Append the given values to the string.
57
+ *
58
+ * @param array $values
59
+ * @return static
60
+ */
61
+ public function append(...$values)
62
+ {
63
+ return new static($this->value.implode('', $values));
64
+ }
65
+
66
+ /**
67
+ * Transliterate a UTF-8 value to ASCII.
68
+ *
69
+ * @param string $language
70
+ * @return static
71
+ */
72
+ public function ascii($language = 'en')
73
+ {
74
+ return new static(Str::ascii($this->value, $language));
75
+ }
76
+
77
+ /**
78
+ * Get the trailing name component of the path.
79
+ *
80
+ * @param string $suffix
81
+ * @return static
82
+ */
83
+ public function basename($suffix = '')
84
+ {
85
+ return new static(basename($this->value, $suffix));
86
+ }
87
+
88
+ /**
89
+ * Get the basename of the class path.
90
+ *
91
+ * @return static
92
+ */
93
+ public function classBasename()
94
+ {
95
+ return new static(class_basename($this->value));
96
+ }
97
+
98
+ /**
99
+ * Get the portion of a string before the first occurrence of a given value.
100
+ *
101
+ * @param string $search
102
+ * @return static
103
+ */
104
+ public function before($search)
105
+ {
106
+ return new static(Str::before($this->value, $search));
107
+ }
108
+
109
+ /**
110
+ * Get the portion of a string before the last occurrence of a given value.
111
+ *
112
+ * @param string $search
113
+ * @return static
114
+ */
115
+ public function beforeLast($search)
116
+ {
117
+ return new static(Str::beforeLast($this->value, $search));
118
+ }
119
+
120
+ /**
121
+ * Get the portion of a string between two given values.
122
+ *
123
+ * @param string $from
124
+ * @param string $to
125
+ * @return static
126
+ */
127
+ public function between($from, $to)
128
+ {
129
+ return new static(Str::between($this->value, $from, $to));
130
+ }
131
+
132
+ /**
133
+ * Convert a value to camel case.
134
+ *
135
+ * @return static
136
+ */
137
+ public function camel()
138
+ {
139
+ return new static(Str::camel($this->value));
140
+ }
141
+
142
+ /**
143
+ * Determine if a given string contains a given substring.
144
+ *
145
+ * @param string|array $needles
146
+ * @return bool
147
+ */
148
+ public function contains($needles)
149
+ {
150
+ return Str::contains($this->value, $needles);
151
+ }
152
+
153
+ /**
154
+ * Determine if a given string contains all array values.
155
+ *
156
+ * @param array $needles
157
+ * @return bool
158
+ */
159
+ public function containsAll(array $needles)
160
+ {
161
+ return Str::containsAll($this->value, $needles);
162
+ }
163
+
164
+ /**
165
+ * Get the parent directory's path.
166
+ *
167
+ * @param int $levels
168
+ * @return static
169
+ */
170
+ public function dirname($levels = 1)
171
+ {
172
+ return new static(dirname($this->value, $levels));
173
+ }
174
+
175
+ /**
176
+ * Determine if a given string ends with a given substring.
177
+ *
178
+ * @param string|array $needles
179
+ * @return bool
180
+ */
181
+ public function endsWith($needles)
182
+ {
183
+ return Str::endsWith($this->value, $needles);
184
+ }
185
+
186
+ /**
187
+ * Determine if the string is an exact match with the given value.
188
+ *
189
+ * @param string $value
190
+ * @return bool
191
+ */
192
+ public function exactly($value)
193
+ {
194
+ return $this->value === $value;
195
+ }
196
+
197
+ /**
198
+ * Explode the string into an array.
199
+ *
200
+ * @param string $delimiter
201
+ * @param int $limit
202
+ * @return \Illuminate\Support\Collection
203
+ */
204
+ public function explode($delimiter, $limit = PHP_INT_MAX)
205
+ {
206
+ return collect(explode($delimiter, $this->value, $limit));
207
+ }
208
+
209
+ /**
210
+ * Split a string using a regular expression or by length.
211
+ *
212
+ * @param string|int $pattern
213
+ * @param int $limit
214
+ * @param int $flags
215
+ * @return \Illuminate\Support\Collection
216
+ */
217
+ public function split($pattern, $limit = -1, $flags = 0)
218
+ {
219
+ if (filter_var($pattern, FILTER_VALIDATE_INT) !== false) {
220
+ return collect(mb_str_split($this->value, $pattern));
221
+ }
222
+
223
+ $segments = preg_split($pattern, $this->value, $limit, $flags);
224
+
225
+ return ! empty($segments) ? collect($segments) : collect();
226
+ }
227
+
228
+ /**
229
+ * Cap a string with a single instance of a given value.
230
+ *
231
+ * @param string $cap
232
+ * @return static
233
+ */
234
+ public function finish($cap)
235
+ {
236
+ return new static(Str::finish($this->value, $cap));
237
+ }
238
+
239
+ /**
240
+ * Determine if a given string matches a given pattern.
241
+ *
242
+ * @param string|array $pattern
243
+ * @return bool
244
+ */
245
+ public function is($pattern)
246
+ {
247
+ return Str::is($pattern, $this->value);
248
+ }
249
+
250
+ /**
251
+ * Determine if a given string is 7 bit ASCII.
252
+ *
253
+ * @return bool
254
+ */
255
+ public function isAscii()
256
+ {
257
+ return Str::isAscii($this->value);
258
+ }
259
+
260
+ /**
261
+ * Determine if the given string is empty.
262
+ *
263
+ * @return bool
264
+ */
265
+ public function isEmpty()
266
+ {
267
+ return $this->value === '';
268
+ }
269
+
270
+ /**
271
+ * Determine if the given string is not empty.
272
+ *
273
+ * @return bool
274
+ */
275
+ public function isNotEmpty()
276
+ {
277
+ return ! $this->isEmpty();
278
+ }
279
+
280
+ /**
281
+ * Convert a string to kebab case.
282
+ *
283
+ * @return static
284
+ */
285
+ public function kebab()
286
+ {
287
+ return new static(Str::kebab($this->value));
288
+ }
289
+
290
+ /**
291
+ * Return the length of the given string.
292
+ *
293
+ * @param string $encoding
294
+ * @return int
295
+ */
296
+ public function length($encoding = null)
297
+ {
298
+ return Str::length($this->value, $encoding);
299
+ }
300
+
301
+ /**
302
+ * Limit the number of characters in a string.
303
+ *
304
+ * @param int $limit
305
+ * @param string $end
306
+ * @return static
307
+ */
308
+ public function limit($limit = 100, $end = '...')
309
+ {
310
+ return new static(Str::limit($this->value, $limit, $end));
311
+ }
312
+
313
+ /**
314
+ * Convert the given string to lower-case.
315
+ *
316
+ * @return static
317
+ */
318
+ public function lower()
319
+ {
320
+ return new static(Str::lower($this->value));
321
+ }
322
+
323
+ /**
324
+ * Convert GitHub flavored Markdown into HTML.
325
+ *
326
+ * @param array $options
327
+ * @return static
328
+ */
329
+ public function markdown(array $options = [])
330
+ {
331
+ return new static(Str::markdown($this->value, $options));
332
+ }
333
+
334
+ /**
335
+ * Get the string matching the given pattern.
336
+ *
337
+ * @param string $pattern
338
+ * @return static
339
+ */
340
+ public function match($pattern)
341
+ {
342
+ preg_match($pattern, $this->value, $matches);
343
+
344
+ if (! $matches) {
345
+ return new static;
346
+ }
347
+
348
+ return new static($matches[1] ?? $matches[0]);
349
+ }
350
+
351
+ /**
352
+ * Get the string matching the given pattern.
353
+ *
354
+ * @param string $pattern
355
+ * @return \Illuminate\Support\Collection
356
+ */
357
+ public function matchAll($pattern)
358
+ {
359
+ preg_match_all($pattern, $this->value, $matches);
360
+
361
+ if (empty($matches[0])) {
362
+ return collect();
363
+ }
364
+
365
+ return collect($matches[1] ?? $matches[0]);
366
+ }
367
+
368
+ /**
369
+ * Determine if the string matches the given pattern.
370
+ *
371
+ * @param string $pattern
372
+ * @return bool
373
+ */
374
+ public function test($pattern)
375
+ {
376
+ return $this->match($pattern)->isNotEmpty();
377
+ }
378
+
379
+ /**
380
+ * Pad both sides of the string with another.
381
+ *
382
+ * @param int $length
383
+ * @param string $pad
384
+ * @return static
385
+ */
386
+ public function padBoth($length, $pad = ' ')
387
+ {
388
+ return new static(Str::padBoth($this->value, $length, $pad));
389
+ }
390
+
391
+ /**
392
+ * Pad the left side of the string with another.
393
+ *
394
+ * @param int $length
395
+ * @param string $pad
396
+ * @return static
397
+ */
398
+ public function padLeft($length, $pad = ' ')
399
+ {
400
+ return new static(Str::padLeft($this->value, $length, $pad));
401
+ }
402
+
403
+ /**
404
+ * Pad the right side of the string with another.
405
+ *
406
+ * @param int $length
407
+ * @param string $pad
408
+ * @return static
409
+ */
410
+ public function padRight($length, $pad = ' ')
411
+ {
412
+ return new static(Str::padRight($this->value, $length, $pad));
413
+ }
414
+
415
+ /**
416
+ * Parse a Class@method style callback into class and method.
417
+ *
418
+ * @param string|null $default
419
+ * @return array
420
+ */
421
+ public function parseCallback($default = null)
422
+ {
423
+ return Str::parseCallback($this->value, $default);
424
+ }
425
+
426
+ /**
427
+ * Call the given callback and return a new string.
428
+ *
429
+ * @param callable $callback
430
+ * @return static
431
+ */
432
+ public function pipe(callable $callback)
433
+ {
434
+ return new static(call_user_func($callback, $this));
435
+ }
436
+
437
+ /**
438
+ * Get the plural form of an English word.
439
+ *
440
+ * @param int $count
441
+ * @return static
442
+ */
443
+ public function plural($count = 2)
444
+ {
445
+ return new static(Str::plural($this->value, $count));
446
+ }
447
+
448
+ /**
449
+ * Pluralize the last word of an English, studly caps case string.
450
+ *
451
+ * @param int $count
452
+ * @return static
453
+ */
454
+ public function pluralStudly($count = 2)
455
+ {
456
+ return new static(Str::pluralStudly($this->value, $count));
457
+ }
458
+
459
+ /**
460
+ * Prepend the given values to the string.
461
+ *
462
+ * @param array $values
463
+ * @return static
464
+ */
465
+ public function prepend(...$values)
466
+ {
467
+ return new static(implode('', $values).$this->value);
468
+ }
469
+
470
+ /**
471
+ * Remove any occurrence of the given string in the subject.
472
+ *
473
+ * @param string|array<string> $search
474
+ * @param bool $caseSensitive
475
+ * @return static
476
+ */
477
+ public function remove($search, $caseSensitive = true)
478
+ {
479
+ return new static(Str::remove($search, $this->value, $caseSensitive));
480
+ }
481
+
482
+ /**
483
+ * Repeat the string.
484
+ *
485
+ * @param int $times
486
+ * @return static
487
+ */
488
+ public function repeat(int $times)
489
+ {
490
+ return new static(Str::repeat($this->value, $times));
491
+ }
492
+
493
+ /**
494
+ * Replace the given value in the given string.
495
+ *
496
+ * @param string|string[] $search
497
+ * @param string|string[] $replace
498
+ * @return static
499
+ */
500
+ public function replace($search, $replace)
501
+ {
502
+ return new static(str_replace($search, $replace, $this->value));
503
+ }
504
+
505
+ /**
506
+ * Replace a given value in the string sequentially with an array.
507
+ *
508
+ * @param string $search
509
+ * @param array $replace
510
+ * @return static
511
+ */
512
+ public function replaceArray($search, array $replace)
513
+ {
514
+ return new static(Str::replaceArray($search, $replace, $this->value));
515
+ }
516
+
517
+ /**
518
+ * Replace the first occurrence of a given value in the string.
519
+ *
520
+ * @param string $search
521
+ * @param string $replace
522
+ * @return static
523
+ */
524
+ public function replaceFirst($search, $replace)
525
+ {
526
+ return new static(Str::replaceFirst($search, $replace, $this->value));
527
+ }
528
+
529
+ /**
530
+ * Replace the last occurrence of a given value in the string.
531
+ *
532
+ * @param string $search
533
+ * @param string $replace
534
+ * @return static
535
+ */
536
+ public function replaceLast($search, $replace)
537
+ {
538
+ return new static(Str::replaceLast($search, $replace, $this->value));
539
+ }
540
+
541
+ /**
542
+ * Replace the patterns matching the given regular expression.
543
+ *
544
+ * @param string $pattern
545
+ * @param \Closure|string $replace
546
+ * @param int $limit
547
+ * @return static
548
+ */
549
+ public function replaceMatches($pattern, $replace, $limit = -1)
550
+ {
551
+ if ($replace instanceof Closure) {
552
+ return new static(preg_replace_callback($pattern, $replace, $this->value, $limit));
553
+ }
554
+
555
+ return new static(preg_replace($pattern, $replace, $this->value, $limit));
556
+ }
557
+
558
+ /**
559
+ * Begin a string with a single instance of a given value.
560
+ *
561
+ * @param string $prefix
562
+ * @return static
563
+ */
564
+ public function start($prefix)
565
+ {
566
+ return new static(Str::start($this->value, $prefix));
567
+ }
568
+
569
+ /**
570
+ * Convert the given string to upper-case.
571
+ *
572
+ * @return static
573
+ */
574
+ public function upper()
575
+ {
576
+ return new static(Str::upper($this->value));
577
+ }
578
+
579
+ /**
580
+ * Convert the given string to title case.
581
+ *
582
+ * @return static
583
+ */
584
+ public function title()
585
+ {
586
+ return new static(Str::title($this->value));
587
+ }
588
+
589
+ /**
590
+ * Get the singular form of an English word.
591
+ *
592
+ * @return static
593
+ */
594
+ public function singular()
595
+ {
596
+ return new static(Str::singular($this->value));
597
+ }
598
+
599
+ /**
600
+ * Generate a URL friendly "slug" from a given string.
601
+ *
602
+ * @param string $separator
603
+ * @param string|null $language
604
+ * @return static
605
+ */
606
+ public function slug($separator = '-', $language = 'en')
607
+ {
608
+ return new static(Str::slug($this->value, $separator, $language));
609
+ }
610
+
611
+ /**
612
+ * Convert a string to snake case.
613
+ *
614
+ * @param string $delimiter
615
+ * @return static
616
+ */
617
+ public function snake($delimiter = '_')
618
+ {
619
+ return new static(Str::snake($this->value, $delimiter));
620
+ }
621
+
622
+ /**
623
+ * Determine if a given string starts with a given substring.
624
+ *
625
+ * @param string|array $needles
626
+ * @return bool
627
+ */
628
+ public function startsWith($needles)
629
+ {
630
+ return Str::startsWith($this->value, $needles);
631
+ }
632
+
633
+ /**
634
+ * Convert a value to studly caps case.
635
+ *
636
+ * @return static
637
+ */
638
+ public function studly()
639
+ {
640
+ return new static(Str::studly($this->value));
641
+ }
642
+
643
+ /**
644
+ * Returns the portion of the string specified by the start and length parameters.
645
+ *
646
+ * @param int $start
647
+ * @param int|null $length
648
+ * @return static
649
+ */
650
+ public function substr($start, $length = null)
651
+ {
652
+ return new static(Str::substr($this->value, $start, $length));
653
+ }
654
+
655
+ /**
656
+ * Returns the number of substring occurrences.
657
+ *
658
+ * @param string $needle
659
+ * @param int|null $offset
660
+ * @param int|null $length
661
+ * @return int
662
+ */
663
+ public function substrCount($needle, $offset = null, $length = null)
664
+ {
665
+ return Str::substrCount($this->value, $needle, $offset, $length);
666
+ }
667
+
668
+ /**
669
+ * Trim the string of the given characters.
670
+ *
671
+ * @param string $characters
672
+ * @return static
673
+ */
674
+ public function trim($characters = null)
675
+ {
676
+ return new static(trim(...array_merge([$this->value], func_get_args())));
677
+ }
678
+
679
+ /**
680
+ * Left trim the string of the given characters.
681
+ *
682
+ * @param string $characters
683
+ * @return static
684
+ */
685
+ public function ltrim($characters = null)
686
+ {
687
+ return new static(ltrim(...array_merge([$this->value], func_get_args())));
688
+ }
689
+
690
+ /**
691
+ * Right trim the string of the given characters.
692
+ *
693
+ * @param string $characters
694
+ * @return static
695
+ */
696
+ public function rtrim($characters = null)
697
+ {
698
+ return new static(rtrim(...array_merge([$this->value], func_get_args())));
699
+ }
700
+
701
+ /**
702
+ * Make a string's first character uppercase.
703
+ *
704
+ * @return static
705
+ */
706
+ public function ucfirst()
707
+ {
708
+ return new static(Str::ucfirst($this->value));
709
+ }
710
+
711
+ /**
712
+ * Apply the callback's string changes if the given "value" is true.
713
+ *
714
+ * @param mixed $value
715
+ * @param callable $callback
716
+ * @param callable|null $default
717
+ * @return mixed|$this
718
+ */
719
+ public function when($value, $callback, $default = null)
720
+ {
721
+ if ($value) {
722
+ return $callback($this, $value) ?: $this;
723
+ } elseif ($default) {
724
+ return $default($this, $value) ?: $this;
725
+ }
726
+
727
+ return $this;
728
+ }
729
+
730
+ /**
731
+ * Execute the given callback if the string is empty.
732
+ *
733
+ * @param callable $callback
734
+ * @return static
735
+ */
736
+ public function whenEmpty($callback)
737
+ {
738
+ if ($this->isEmpty()) {
739
+ $result = $callback($this);
740
+
741
+ return is_null($result) ? $this : $result;
742
+ }
743
+
744
+ return $this;
745
+ }
746
+
747
+ /**
748
+ * Limit the number of words in a string.
749
+ *
750
+ * @param int $words
751
+ * @param string $end
752
+ * @return static
753
+ */
754
+ public function words($words = 100, $end = '...')
755
+ {
756
+ return new static(Str::words($this->value, $words, $end));
757
+ }
758
+
759
+ /**
760
+ * Dump the string.
761
+ *
762
+ * @return $this
763
+ */
764
+ public function dump()
765
+ {
766
+ VarDumper::dump($this->value);
767
+
768
+ return $this;
769
+ }
770
+
771
+ /**
772
+ * Dump the string and end the script.
773
+ *
774
+ * @return void
775
+ */
776
+ public function dd()
777
+ {
778
+ $this->dump();
779
+
780
+ exit(1);
781
+ }
782
+
783
+ /**
784
+ * Convert the object to a string when JSON encoded.
785
+ *
786
+ * @return string
787
+ */
788
+ public function jsonSerialize()
789
+ {
790
+ return $this->__toString();
791
+ }
792
+
793
+ /**
794
+ * Proxy dynamic properties onto methods.
795
+ *
796
+ * @param string $key
797
+ * @return mixed
798
+ */
799
+ public function __get($key)
800
+ {
801
+ return $this->{$key}();
802
+ }
803
+
804
+ /**
805
+ * Get the raw string value.
806
+ *
807
+ * @return string
808
+ */
809
+ public function __toString()
810
+ {
811
+ return (string) $this->value;
812
+ }
813
+ }
vendor/illuminate/support/Testing/Fakes/BatchRepositoryFake.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Testing\Fakes;
4
+
5
+ use Carbon\CarbonImmutable;
6
+ use Closure;
7
+ use Illuminate\Bus\Batch;
8
+ use Illuminate\Bus\BatchRepository;
9
+ use Illuminate\Bus\PendingBatch;
10
+ use Illuminate\Bus\UpdatedBatchJobCounts;
11
+ use Illuminate\Support\Facades\Facade;
12
+ use Illuminate\Support\Str;
13
+
14
+ class BatchRepositoryFake implements BatchRepository
15
+ {
16
+ /**
17
+ * Retrieve a list of batches.
18
+ *
19
+ * @param int $limit
20
+ * @param mixed $before
21
+ * @return \Illuminate\Bus\Batch[]
22
+ */
23
+ public function get($limit, $before)
24
+ {
25
+ return [];
26
+ }
27
+
28
+ /**
29
+ * Retrieve information about an existing batch.
30
+ *
31
+ * @param string $batchId
32
+ * @return \Illuminate\Bus\Batch|null
33
+ */
34
+ public function find(string $batchId)
35
+ {
36
+ //
37
+ }
38
+
39
+ /**
40
+ * Store a new pending batch.
41
+ *
42
+ * @param \Illuminate\Bus\PendingBatch $batch
43
+ * @return \Illuminate\Bus\Batch
44
+ */
45
+ public function store(PendingBatch $batch)
46
+ {
47
+ return new Batch(
48
+ new QueueFake(Facade::getFacadeApplication()),
49
+ $this,
50
+ (string) Str::orderedUuid(),
51
+ $batch->name,
52
+ count($batch->jobs),
53
+ count($batch->jobs),
54
+ 0,
55
+ [],
56
+ $batch->options,
57
+ CarbonImmutable::now(),
58
+ null,
59
+ null
60
+ );
61
+ }
62
+
63
+ /**
64
+ * Increment the total number of jobs within the batch.
65
+ *
66
+ * @param string $batchId
67
+ * @param int $amount
68
+ * @return void
69
+ */
70
+ public function incrementTotalJobs(string $batchId, int $amount)
71
+ {
72
+ //
73
+ }
74
+
75
+ /**
76
+ * Decrement the total number of pending jobs for the batch.
77
+ *
78
+ * @param string $batchId
79
+ * @param string $jobId
80
+ * @return \Illuminate\Bus\UpdatedBatchJobCounts
81
+ */
82
+ public function decrementPendingJobs(string $batchId, string $jobId)
83
+ {
84
+ return new UpdatedBatchJobCounts;
85
+ }
86
+
87
+ /**
88
+ * Increment the total number of failed jobs for the batch.
89
+ *
90
+ * @param string $batchId
91
+ * @param string $jobId
92
+ * @return \Illuminate\Bus\UpdatedBatchJobCounts
93
+ */
94
+ public function incrementFailedJobs(string $batchId, string $jobId)
95
+ {
96
+ return new UpdatedBatchJobCounts;
97
+ }
98
+
99
+ /**
100
+ * Mark the batch that has the given ID as finished.
101
+ *
102
+ * @param string $batchId
103
+ * @return void
104
+ */
105
+ public function markAsFinished(string $batchId)
106
+ {
107
+ //
108
+ }
109
+
110
+ /**
111
+ * Cancel the batch that has the given ID.
112
+ *
113
+ * @param string $batchId
114
+ * @return void
115
+ */
116
+ public function cancel(string $batchId)
117
+ {
118
+ //
119
+ }
120
+
121
+ /**
122
+ * Delete the batch that has the given ID.
123
+ *
124
+ * @param string $batchId
125
+ * @return void
126
+ */
127
+ public function delete(string $batchId)
128
+ {
129
+ //
130
+ }
131
+
132
+ /**
133
+ * Execute the given Closure within a storage specific transaction.
134
+ *
135
+ * @param \Closure $callback
136
+ * @return mixed
137
+ */
138
+ public function transaction(Closure $callback)
139
+ {
140
+ return $callback();
141
+ }
142
+ }
vendor/illuminate/support/Testing/Fakes/BusFake.php CHANGED
@@ -2,11 +2,32 @@
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
- use Illuminate\Contracts\Bus\Dispatcher;
 
 
 
 
 
6
  use PHPUnit\Framework\Assert as PHPUnit;
7
 
8
- class BusFake implements Dispatcher
9
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * The commands that have been dispatched.
12
  *
@@ -14,36 +35,305 @@ class BusFake implements Dispatcher
14
  */
15
  protected $commands = [];
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Assert if a job was dispatched based on a truth-test callback.
19
  *
20
- * @param string $command
21
- * @param callable|null $callback
22
  * @return void
23
  */
24
  public function assertDispatched($command, $callback = null)
25
  {
 
 
 
 
 
 
 
 
26
  PHPUnit::assertTrue(
27
- $this->dispatched($command, $callback)->count() > 0,
 
28
  "The expected [{$command}] job was not dispatched."
29
  );
30
  }
31
 
32
  /**
33
- * Determine if a job was dispatched based on a truth-test callback.
34
  *
35
  * @param string $command
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  * @param callable|null $callback
37
  * @return void
38
  */
39
  public function assertNotDispatched($command, $callback = null)
40
  {
 
 
 
 
41
  PHPUnit::assertTrue(
42
- $this->dispatched($command, $callback)->count() === 0,
 
43
  "The unexpected [{$command}] job was dispatched."
44
  );
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Get all of the jobs matching a truth-test callback.
49
  *
@@ -66,6 +356,45 @@ class BusFake implements Dispatcher
66
  });
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  /**
70
  * Determine if there are any stored commands for a given class.
71
  *
@@ -77,6 +406,17 @@ class BusFake implements Dispatcher
77
  return isset($this->commands[$command]) && ! empty($this->commands[$command]);
78
  }
79
 
 
 
 
 
 
 
 
 
 
 
 
80
  /**
81
  * Dispatch a command to its appropriate handler.
82
  *
@@ -85,7 +425,29 @@ class BusFake implements Dispatcher
85
  */
86
  public function dispatch($command)
87
  {
88
- return $this->dispatchNow($command);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
 
91
  /**
@@ -97,7 +459,109 @@ class BusFake implements Dispatcher
97
  */
98
  public function dispatchNow($command, $handler = null)
99
  {
100
- $this->commands[get_class($command)][] = $command;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  }
102
 
103
  /**
@@ -108,6 +572,43 @@ class BusFake implements Dispatcher
108
  */
109
  public function pipeThrough(array $pipes)
110
  {
111
- //
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  }
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
+ use Closure;
6
+ use Illuminate\Bus\PendingBatch;
7
+ use Illuminate\Contracts\Bus\QueueingDispatcher;
8
+ use Illuminate\Support\Arr;
9
+ use Illuminate\Support\Collection;
10
+ use Illuminate\Support\Traits\ReflectsClosures;
11
  use PHPUnit\Framework\Assert as PHPUnit;
12
 
13
+ class BusFake implements QueueingDispatcher
14
  {
15
+ use ReflectsClosures;
16
+
17
+ /**
18
+ * The original Bus dispatcher implementation.
19
+ *
20
+ * @var \Illuminate\Contracts\Bus\QueueingDispatcher
21
+ */
22
+ protected $dispatcher;
23
+
24
+ /**
25
+ * The job types that should be intercepted instead of dispatched.
26
+ *
27
+ * @var array
28
+ */
29
+ protected $jobsToFake;
30
+
31
  /**
32
  * The commands that have been dispatched.
33
  *
35
  */
36
  protected $commands = [];
37
 
38
+ /**
39
+ * The commands that have been dispatched after the response has been sent.
40
+ *
41
+ * @var array
42
+ */
43
+ protected $commandsAfterResponse = [];
44
+
45
+ /**
46
+ * The batches that have been dispatched.
47
+ *
48
+ * @var array
49
+ */
50
+ protected $batches = [];
51
+
52
+ /**
53
+ * Create a new bus fake instance.
54
+ *
55
+ * @param \Illuminate\Contracts\Bus\QueueingDispatcher $dispatcher
56
+ * @param array|string $jobsToFake
57
+ * @return void
58
+ */
59
+ public function __construct(QueueingDispatcher $dispatcher, $jobsToFake = [])
60
+ {
61
+ $this->dispatcher = $dispatcher;
62
+
63
+ $this->jobsToFake = Arr::wrap($jobsToFake);
64
+ }
65
+
66
  /**
67
  * Assert if a job was dispatched based on a truth-test callback.
68
  *
69
+ * @param string|\Closure $command
70
+ * @param callable|int|null $callback
71
  * @return void
72
  */
73
  public function assertDispatched($command, $callback = null)
74
  {
75
+ if ($command instanceof Closure) {
76
+ [$command, $callback] = [$this->firstClosureParameterType($command), $command];
77
+ }
78
+
79
+ if (is_numeric($callback)) {
80
+ return $this->assertDispatchedTimes($command, $callback);
81
+ }
82
+
83
  PHPUnit::assertTrue(
84
+ $this->dispatched($command, $callback)->count() > 0 ||
85
+ $this->dispatchedAfterResponse($command, $callback)->count() > 0,
86
  "The expected [{$command}] job was not dispatched."
87
  );
88
  }
89
 
90
  /**
91
+ * Assert if a job was pushed a number of times.
92
  *
93
  * @param string $command
94
+ * @param int $times
95
+ * @return void
96
+ */
97
+ public function assertDispatchedTimes($command, $times = 1)
98
+ {
99
+ $count = $this->dispatched($command)->count() +
100
+ $this->dispatchedAfterResponse($command)->count();
101
+
102
+ PHPUnit::assertSame(
103
+ $times, $count,
104
+ "The expected [{$command}] job was pushed {$count} times instead of {$times} times."
105
+ );
106
+ }
107
+
108
+ /**
109
+ * Determine if a job was dispatched based on a truth-test callback.
110
+ *
111
+ * @param string|\Closure $command
112
  * @param callable|null $callback
113
  * @return void
114
  */
115
  public function assertNotDispatched($command, $callback = null)
116
  {
117
+ if ($command instanceof Closure) {
118
+ [$command, $callback] = [$this->firstClosureParameterType($command), $command];
119
+ }
120
+
121
  PHPUnit::assertTrue(
122
+ $this->dispatched($command, $callback)->count() === 0 &&
123
+ $this->dispatchedAfterResponse($command, $callback)->count() === 0,
124
  "The unexpected [{$command}] job was dispatched."
125
  );
126
  }
127
 
128
+ /**
129
+ * Assert if a job was dispatched after the response was sent based on a truth-test callback.
130
+ *
131
+ * @param string|\Closure $command
132
+ * @param callable|int|null $callback
133
+ * @return void
134
+ */
135
+ public function assertDispatchedAfterResponse($command, $callback = null)
136
+ {
137
+ if ($command instanceof Closure) {
138
+ [$command, $callback] = [$this->firstClosureParameterType($command), $command];
139
+ }
140
+
141
+ if (is_numeric($callback)) {
142
+ return $this->assertDispatchedAfterResponseTimes($command, $callback);
143
+ }
144
+
145
+ PHPUnit::assertTrue(
146
+ $this->dispatchedAfterResponse($command, $callback)->count() > 0,
147
+ "The expected [{$command}] job was not dispatched for after sending the response."
148
+ );
149
+ }
150
+
151
+ /**
152
+ * Assert if a job was pushed after the response was sent a number of times.
153
+ *
154
+ * @param string $command
155
+ * @param int $times
156
+ * @return void
157
+ */
158
+ public function assertDispatchedAfterResponseTimes($command, $times = 1)
159
+ {
160
+ $count = $this->dispatchedAfterResponse($command)->count();
161
+
162
+ PHPUnit::assertSame(
163
+ $times, $count,
164
+ "The expected [{$command}] job was pushed {$count} times instead of {$times} times."
165
+ );
166
+ }
167
+
168
+ /**
169
+ * Determine if a job was dispatched based on a truth-test callback.
170
+ *
171
+ * @param string|\Closure $command
172
+ * @param callable|null $callback
173
+ * @return void
174
+ */
175
+ public function assertNotDispatchedAfterResponse($command, $callback = null)
176
+ {
177
+ if ($command instanceof Closure) {
178
+ [$command, $callback] = [$this->firstClosureParameterType($command), $command];
179
+ }
180
+
181
+ PHPUnit::assertCount(
182
+ 0, $this->dispatchedAfterResponse($command, $callback),
183
+ "The unexpected [{$command}] job was dispatched for after sending the response."
184
+ );
185
+ }
186
+
187
+ /**
188
+ * Assert if a chain of jobs was dispatched.
189
+ *
190
+ * @param array $expectedChain
191
+ * @return void
192
+ */
193
+ public function assertChained(array $expectedChain)
194
+ {
195
+ $command = $expectedChain[0];
196
+
197
+ $expectedChain = array_slice($expectedChain, 1);
198
+
199
+ $callback = null;
200
+
201
+ if ($command instanceof Closure) {
202
+ [$command, $callback] = [$this->firstClosureParameterType($command), $command];
203
+ } elseif (! is_string($command)) {
204
+ $instance = $command;
205
+
206
+ $command = get_class($instance);
207
+
208
+ $callback = function ($job) use ($instance) {
209
+ return serialize($this->resetChainPropertiesToDefaults($job)) === serialize($instance);
210
+ };
211
+ }
212
+
213
+ PHPUnit::assertTrue(
214
+ $this->dispatched($command, $callback)->isNotEmpty(),
215
+ "The expected [{$command}] job was not dispatched."
216
+ );
217
+
218
+ PHPUnit::assertTrue(
219
+ collect($expectedChain)->isNotEmpty(),
220
+ 'The expected chain can not be empty.'
221
+ );
222
+
223
+ $this->isChainOfObjects($expectedChain)
224
+ ? $this->assertDispatchedWithChainOfObjects($command, $expectedChain, $callback)
225
+ : $this->assertDispatchedWithChainOfClasses($command, $expectedChain, $callback);
226
+ }
227
+
228
+ /**
229
+ * Reset the chain properties to their default values on the job.
230
+ *
231
+ * @param mixed $job
232
+ * @return mixed
233
+ */
234
+ protected function resetChainPropertiesToDefaults($job)
235
+ {
236
+ return tap(clone $job, function ($job) {
237
+ $job->chainConnection = null;
238
+ $job->chainQueue = null;
239
+ $job->chainCatchCallbacks = null;
240
+ $job->chained = [];
241
+ });
242
+ }
243
+
244
+ /**
245
+ * Assert if a job was dispatched with an empty chain based on a truth-test callback.
246
+ *
247
+ * @param string|\Closure $command
248
+ * @param callable|null $callback
249
+ * @return void
250
+ */
251
+ public function assertDispatchedWithoutChain($command, $callback = null)
252
+ {
253
+ if ($command instanceof Closure) {
254
+ [$command, $callback] = [$this->firstClosureParameterType($command), $command];
255
+ }
256
+
257
+ PHPUnit::assertTrue(
258
+ $this->dispatched($command, $callback)->isNotEmpty(),
259
+ "The expected [{$command}] job was not dispatched."
260
+ );
261
+
262
+ $this->assertDispatchedWithChainOfClasses($command, [], $callback);
263
+ }
264
+
265
+ /**
266
+ * Assert if a job was dispatched with chained jobs based on a truth-test callback.
267
+ *
268
+ * @param string $command
269
+ * @param array $expectedChain
270
+ * @param callable|null $callback
271
+ * @return void
272
+ */
273
+ protected function assertDispatchedWithChainOfObjects($command, $expectedChain, $callback)
274
+ {
275
+ $chain = collect($expectedChain)->map(function ($job) {
276
+ return serialize($job);
277
+ })->all();
278
+
279
+ PHPUnit::assertTrue(
280
+ $this->dispatched($command, $callback)->filter(function ($job) use ($chain) {
281
+ return $job->chained == $chain;
282
+ })->isNotEmpty(),
283
+ 'The expected chain was not dispatched.'
284
+ );
285
+ }
286
+
287
+ /**
288
+ * Assert if a job was dispatched with chained jobs based on a truth-test callback.
289
+ *
290
+ * @param string $command
291
+ * @param array $expectedChain
292
+ * @param callable|null $callback
293
+ * @return void
294
+ */
295
+ protected function assertDispatchedWithChainOfClasses($command, $expectedChain, $callback)
296
+ {
297
+ $matching = $this->dispatched($command, $callback)->map->chained->map(function ($chain) {
298
+ return collect($chain)->map(function ($job) {
299
+ return get_class(unserialize($job));
300
+ });
301
+ })->filter(function ($chain) use ($expectedChain) {
302
+ return $chain->all() === $expectedChain;
303
+ });
304
+
305
+ PHPUnit::assertTrue(
306
+ $matching->isNotEmpty(), 'The expected chain was not dispatched.'
307
+ );
308
+ }
309
+
310
+ /**
311
+ * Determine if the given chain is entirely composed of objects.
312
+ *
313
+ * @param array $chain
314
+ * @return bool
315
+ */
316
+ protected function isChainOfObjects($chain)
317
+ {
318
+ return ! collect($chain)->contains(function ($job) {
319
+ return ! is_object($job);
320
+ });
321
+ }
322
+
323
+ /**
324
+ * Assert if a batch was dispatched based on a truth-test callback.
325
+ *
326
+ * @param callable $callback
327
+ * @return void
328
+ */
329
+ public function assertBatched(callable $callback)
330
+ {
331
+ PHPUnit::assertTrue(
332
+ $this->batched($callback)->count() > 0,
333
+ 'The expected batch was not dispatched.'
334
+ );
335
+ }
336
+
337
  /**
338
  * Get all of the jobs matching a truth-test callback.
339
  *
356
  });
357
  }
358
 
359
+ /**
360
+ * Get all of the jobs dispatched after the response was sent matching a truth-test callback.
361
+ *
362
+ * @param string $command
363
+ * @param callable|null $callback
364
+ * @return \Illuminate\Support\Collection
365
+ */
366
+ public function dispatchedAfterResponse(string $command, $callback = null)
367
+ {
368
+ if (! $this->hasDispatchedAfterResponse($command)) {
369
+ return collect();
370
+ }
371
+
372
+ $callback = $callback ?: function () {
373
+ return true;
374
+ };
375
+
376
+ return collect($this->commandsAfterResponse[$command])->filter(function ($command) use ($callback) {
377
+ return $callback($command);
378
+ });
379
+ }
380
+
381
+ /**
382
+ * Get all of the pending batches matching a truth-test callback.
383
+ *
384
+ * @param callable $callback
385
+ * @return \Illuminate\Support\Collection
386
+ */
387
+ public function batched(callable $callback)
388
+ {
389
+ if (empty($this->batches)) {
390
+ return collect();
391
+ }
392
+
393
+ return collect($this->batches)->filter(function ($batch) use ($callback) {
394
+ return $callback($batch);
395
+ });
396
+ }
397
+
398
  /**
399
  * Determine if there are any stored commands for a given class.
400
  *
406
  return isset($this->commands[$command]) && ! empty($this->commands[$command]);
407
  }
408
 
409
+ /**
410
+ * Determine if there are any stored commands for a given class.
411
+ *
412
+ * @param string $command
413
+ * @return bool
414
+ */
415
+ public function hasDispatchedAfterResponse($command)
416
+ {
417
+ return isset($this->commandsAfterResponse[$command]) && ! empty($this->commandsAfterResponse[$command]);
418
+ }
419
+
420
  /**
421
  * Dispatch a command to its appropriate handler.
422
  *
425
  */
426
  public function dispatch($command)
427
  {
428
+ if ($this->shouldFakeJob($command)) {
429
+ $this->commands[get_class($command)][] = $command;
430
+ } else {
431
+ return $this->dispatcher->dispatch($command);
432
+ }
433
+ }
434
+
435
+ /**
436
+ * Dispatch a command to its appropriate handler in the current process.
437
+ *
438
+ * Queueable jobs will be dispatched to the "sync" queue.
439
+ *
440
+ * @param mixed $command
441
+ * @param mixed $handler
442
+ * @return mixed
443
+ */
444
+ public function dispatchSync($command, $handler = null)
445
+ {
446
+ if ($this->shouldFakeJob($command)) {
447
+ $this->commands[get_class($command)][] = $command;
448
+ } else {
449
+ return $this->dispatcher->dispatchSync($command, $handler);
450
+ }
451
  }
452
 
453
  /**
459
  */
460
  public function dispatchNow($command, $handler = null)
461
  {
462
+ if ($this->shouldFakeJob($command)) {
463
+ $this->commands[get_class($command)][] = $command;
464
+ } else {
465
+ return $this->dispatcher->dispatchNow($command, $handler);
466
+ }
467
+ }
468
+
469
+ /**
470
+ * Dispatch a command to its appropriate handler behind a queue.
471
+ *
472
+ * @param mixed $command
473
+ * @return mixed
474
+ */
475
+ public function dispatchToQueue($command)
476
+ {
477
+ if ($this->shouldFakeJob($command)) {
478
+ $this->commands[get_class($command)][] = $command;
479
+ } else {
480
+ return $this->dispatcher->dispatchToQueue($command);
481
+ }
482
+ }
483
+
484
+ /**
485
+ * Dispatch a command to its appropriate handler.
486
+ *
487
+ * @param mixed $command
488
+ * @return mixed
489
+ */
490
+ public function dispatchAfterResponse($command)
491
+ {
492
+ if ($this->shouldFakeJob($command)) {
493
+ $this->commandsAfterResponse[get_class($command)][] = $command;
494
+ } else {
495
+ return $this->dispatcher->dispatch($command);
496
+ }
497
+ }
498
+
499
+ /**
500
+ * Create a new chain of queueable jobs.
501
+ *
502
+ * @param \Illuminate\Support\Collection|array $jobs
503
+ * @return \Illuminate\Foundation\Bus\PendingChain
504
+ */
505
+ public function chain($jobs)
506
+ {
507
+ $jobs = Collection::wrap($jobs);
508
+
509
+ return new PendingChainFake($this, $jobs->shift(), $jobs->toArray());
510
+ }
511
+
512
+ /**
513
+ * Attempt to find the batch with the given ID.
514
+ *
515
+ * @param string $batchId
516
+ * @return \Illuminate\Bus\Batch|null
517
+ */
518
+ public function findBatch(string $batchId)
519
+ {
520
+ //
521
+ }
522
+
523
+ /**
524
+ * Create a new batch of queueable jobs.
525
+ *
526
+ * @param \Illuminate\Support\Collection|array $jobs
527
+ * @return \Illuminate\Bus\PendingBatch
528
+ */
529
+ public function batch($jobs)
530
+ {
531
+ return new PendingBatchFake($this, Collection::wrap($jobs));
532
+ }
533
+
534
+ /**
535
+ * Record the fake pending batch dispatch.
536
+ *
537
+ * @param \Illuminate\Bus\PendingBatch $pendingBatch
538
+ * @return \Illuminate\Bus\Batch
539
+ */
540
+ public function recordPendingBatch(PendingBatch $pendingBatch)
541
+ {
542
+ $this->batches[] = $pendingBatch;
543
+
544
+ return (new BatchRepositoryFake)->store($pendingBatch);
545
+ }
546
+
547
+ /**
548
+ * Determine if a command should be faked or actually dispatched.
549
+ *
550
+ * @param mixed $command
551
+ * @return bool
552
+ */
553
+ protected function shouldFakeJob($command)
554
+ {
555
+ if (empty($this->jobsToFake)) {
556
+ return true;
557
+ }
558
+
559
+ return collect($this->jobsToFake)
560
+ ->filter(function ($job) use ($command) {
561
+ return $job instanceof Closure
562
+ ? $job($command)
563
+ : $job === get_class($command);
564
+ })->isNotEmpty();
565
  }
566
 
567
  /**
572
  */
573
  public function pipeThrough(array $pipes)
574
  {
575
+ $this->dispatcher->pipeThrough($pipes);
576
+
577
+ return $this;
578
+ }
579
+
580
+ /**
581
+ * Determine if the given command has a handler.
582
+ *
583
+ * @param mixed $command
584
+ * @return bool
585
+ */
586
+ public function hasCommandHandler($command)
587
+ {
588
+ return $this->dispatcher->hasCommandHandler($command);
589
+ }
590
+
591
+ /**
592
+ * Retrieve the handler for a command.
593
+ *
594
+ * @param mixed $command
595
+ * @return mixed
596
+ */
597
+ public function getCommandHandler($command)
598
+ {
599
+ return $this->dispatcher->getCommandHandler($command);
600
+ }
601
+
602
+ /**
603
+ * Map a command to a handler.
604
+ *
605
+ * @param array $map
606
+ * @return $this
607
+ */
608
+ public function map(array $map)
609
+ {
610
+ $this->dispatcher->map($map);
611
+
612
+ return $this;
613
  }
614
  }
vendor/illuminate/support/Testing/Fakes/EventFake.php CHANGED
@@ -2,27 +2,101 @@
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
- use PHPUnit\Framework\Assert as PHPUnit;
6
  use Illuminate\Contracts\Events\Dispatcher;
 
 
 
 
7
 
8
  class EventFake implements Dispatcher
9
  {
 
 
10
  /**
11
- * All of the events that have been dispatched keyed by type.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  *
13
  * @var array
14
  */
15
  protected $events = [];
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Assert if an event was dispatched based on a truth-test callback.
19
  *
20
- * @param string $event
21
- * @param callable|null $callback
22
  * @return void
23
  */
24
  public function assertDispatched($event, $callback = null)
25
  {
 
 
 
 
 
 
 
 
26
  PHPUnit::assertTrue(
27
  $this->dispatched($event, $callback)->count() > 0,
28
  "The expected [{$event}] event was not dispatched."
@@ -30,20 +104,56 @@ class EventFake implements Dispatcher
30
  }
31
 
32
  /**
33
- * Determine if an event was dispatched based on a truth-test callback.
34
  *
35
  * @param string $event
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  * @param callable|null $callback
37
  * @return void
38
  */
39
  public function assertNotDispatched($event, $callback = null)
40
  {
41
- PHPUnit::assertTrue(
42
- $this->dispatched($event, $callback)->count() === 0,
 
 
 
 
43
  "The unexpected [{$event}] event was dispatched."
44
  );
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Get all of the events matching a truth-test callback.
49
  *
@@ -80,13 +190,13 @@ class EventFake implements Dispatcher
80
  /**
81
  * Register an event listener with the dispatcher.
82
  *
83
- * @param string|array $events
84
  * @param mixed $listener
85
  * @return void
86
  */
87
- public function listen($events, $listener)
88
  {
89
- //
90
  }
91
 
92
  /**
@@ -97,7 +207,7 @@ class EventFake implements Dispatcher
97
  */
98
  public function hasListeners($eventName)
99
  {
100
- //
101
  }
102
 
103
  /**
@@ -120,7 +230,7 @@ class EventFake implements Dispatcher
120
  */
121
  public function subscribe($subscriber)
122
  {
123
- //
124
  }
125
 
126
  /**
@@ -142,24 +252,37 @@ class EventFake implements Dispatcher
142
  * @param bool $halt
143
  * @return array|null
144
  */
145
- public function fire($event, $payload = [], $halt = false)
146
  {
147
- return $this->dispatch($event, $payload, $halt);
 
 
 
 
 
 
148
  }
149
 
150
  /**
151
- * Fire an event and call the listeners.
152
  *
153
- * @param string|object $event
154
  * @param mixed $payload
155
- * @param bool $halt
156
- * @return array|null
157
  */
158
- public function dispatch($event, $payload = [], $halt = false)
159
  {
160
- $name = is_object($event) ? get_class($event) : (string) $event;
 
 
161
 
162
- $this->events[$name][] = func_get_args();
 
 
 
 
 
 
163
  }
164
 
165
  /**
@@ -186,9 +309,9 @@ class EventFake implements Dispatcher
186
  /**
187
  * Dispatch an event and call the listeners.
188
  *
189
- * @param string|object $event
190
- * @param mixed $payload
191
- * @return void
192
  */
193
  public function until($event, $payload = [])
194
  {
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
+ use Closure;
6
  use Illuminate\Contracts\Events\Dispatcher;
7
+ use Illuminate\Support\Arr;
8
+ use Illuminate\Support\Traits\ReflectsClosures;
9
+ use PHPUnit\Framework\Assert as PHPUnit;
10
+ use ReflectionFunction;
11
 
12
  class EventFake implements Dispatcher
13
  {
14
+ use ReflectsClosures;
15
+
16
  /**
17
+ * The original event dispatcher.
18
+ *
19
+ * @var \Illuminate\Contracts\Events\Dispatcher
20
+ */
21
+ protected $dispatcher;
22
+
23
+ /**
24
+ * The event types that should be intercepted instead of dispatched.
25
+ *
26
+ * @var array
27
+ */
28
+ protected $eventsToFake;
29
+
30
+ /**
31
+ * All of the events that have been intercepted keyed by type.
32
  *
33
  * @var array
34
  */
35
  protected $events = [];
36
 
37
+ /**
38
+ * Create a new event fake instance.
39
+ *
40
+ * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher
41
+ * @param array|string $eventsToFake
42
+ * @return void
43
+ */
44
+ public function __construct(Dispatcher $dispatcher, $eventsToFake = [])
45
+ {
46
+ $this->dispatcher = $dispatcher;
47
+
48
+ $this->eventsToFake = Arr::wrap($eventsToFake);
49
+ }
50
+
51
+ /**
52
+ * Assert if an event has a listener attached to it.
53
+ *
54
+ * @param string $expectedEvent
55
+ * @param string $expectedListener
56
+ * @return void
57
+ */
58
+ public function assertListening($expectedEvent, $expectedListener)
59
+ {
60
+ foreach ($this->dispatcher->getListeners($expectedEvent) as $listenerClosure) {
61
+ $actualListener = (new ReflectionFunction($listenerClosure))
62
+ ->getStaticVariables()['listener'];
63
+
64
+ if ($actualListener === $expectedListener ||
65
+ ($actualListener instanceof Closure &&
66
+ $expectedListener === Closure::class)) {
67
+ PHPUnit::assertTrue(true);
68
+
69
+ return;
70
+ }
71
+ }
72
+
73
+ PHPUnit::assertTrue(
74
+ false,
75
+ sprintf(
76
+ 'Event [%s] does not have the [%s] listener attached to it',
77
+ $expectedEvent,
78
+ print_r($expectedListener, true)
79
+ )
80
+ );
81
+ }
82
+
83
  /**
84
  * Assert if an event was dispatched based on a truth-test callback.
85
  *
86
+ * @param string|\Closure $event
87
+ * @param callable|int|null $callback
88
  * @return void
89
  */
90
  public function assertDispatched($event, $callback = null)
91
  {
92
+ if ($event instanceof Closure) {
93
+ [$event, $callback] = [$this->firstClosureParameterType($event), $event];
94
+ }
95
+
96
+ if (is_int($callback)) {
97
+ return $this->assertDispatchedTimes($event, $callback);
98
+ }
99
+
100
  PHPUnit::assertTrue(
101
  $this->dispatched($event, $callback)->count() > 0,
102
  "The expected [{$event}] event was not dispatched."
104
  }
105
 
106
  /**
107
+ * Assert if an event was dispatched a number of times.
108
  *
109
  * @param string $event
110
+ * @param int $times
111
+ * @return void
112
+ */
113
+ public function assertDispatchedTimes($event, $times = 1)
114
+ {
115
+ $count = $this->dispatched($event)->count();
116
+
117
+ PHPUnit::assertSame(
118
+ $times, $count,
119
+ "The expected [{$event}] event was dispatched {$count} times instead of {$times} times."
120
+ );
121
+ }
122
+
123
+ /**
124
+ * Determine if an event was dispatched based on a truth-test callback.
125
+ *
126
+ * @param string|\Closure $event
127
  * @param callable|null $callback
128
  * @return void
129
  */
130
  public function assertNotDispatched($event, $callback = null)
131
  {
132
+ if ($event instanceof Closure) {
133
+ [$event, $callback] = [$this->firstClosureParameterType($event), $event];
134
+ }
135
+
136
+ PHPUnit::assertCount(
137
+ 0, $this->dispatched($event, $callback),
138
  "The unexpected [{$event}] event was dispatched."
139
  );
140
  }
141
 
142
+ /**
143
+ * Assert that no events were dispatched.
144
+ *
145
+ * @return void
146
+ */
147
+ public function assertNothingDispatched()
148
+ {
149
+ $count = count(Arr::flatten($this->events));
150
+
151
+ PHPUnit::assertSame(
152
+ 0, $count,
153
+ "{$count} unexpected events were dispatched."
154
+ );
155
+ }
156
+
157
  /**
158
  * Get all of the events matching a truth-test callback.
159
  *
190
  /**
191
  * Register an event listener with the dispatcher.
192
  *
193
+ * @param \Closure|string|array $events
194
  * @param mixed $listener
195
  * @return void
196
  */
197
+ public function listen($events, $listener = null)
198
  {
199
+ $this->dispatcher->listen($events, $listener);
200
  }
201
 
202
  /**
207
  */
208
  public function hasListeners($eventName)
209
  {
210
+ return $this->dispatcher->hasListeners($eventName);
211
  }
212
 
213
  /**
230
  */
231
  public function subscribe($subscriber)
232
  {
233
+ $this->dispatcher->subscribe($subscriber);
234
  }
235
 
236
  /**
252
  * @param bool $halt
253
  * @return array|null
254
  */
255
+ public function dispatch($event, $payload = [], $halt = false)
256
  {
257
+ $name = is_object($event) ? get_class($event) : (string) $event;
258
+
259
+ if ($this->shouldFakeEvent($name, $payload)) {
260
+ $this->events[$name][] = func_get_args();
261
+ } else {
262
+ return $this->dispatcher->dispatch($event, $payload, $halt);
263
+ }
264
  }
265
 
266
  /**
267
+ * Determine if an event should be faked or actually dispatched.
268
  *
269
+ * @param string $eventName
270
  * @param mixed $payload
271
+ * @return bool
 
272
  */
273
+ protected function shouldFakeEvent($eventName, $payload)
274
  {
275
+ if (empty($this->eventsToFake)) {
276
+ return true;
277
+ }
278
 
279
+ return collect($this->eventsToFake)
280
+ ->filter(function ($event) use ($eventName, $payload) {
281
+ return $event instanceof Closure
282
+ ? $event($eventName, $payload)
283
+ : $event === $eventName;
284
+ })
285
+ ->isNotEmpty();
286
  }
287
 
288
  /**
309
  /**
310
  * Dispatch an event and call the listeners.
311
  *
312
+ * @param string|object $event
313
+ * @param mixed $payload
314
+ * @return array|null
315
  */
316
  public function until($event, $payload = [])
317
  {
vendor/illuminate/support/Testing/Fakes/MailFake.php CHANGED
@@ -2,12 +2,26 @@
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
- use Illuminate\Contracts\Mail\Mailer;
 
6
  use Illuminate\Contracts\Mail\Mailable;
 
 
 
 
7
  use PHPUnit\Framework\Assert as PHPUnit;
8
 
9
- class MailFake implements Mailer
10
  {
 
 
 
 
 
 
 
 
 
11
  /**
12
  * All of the mailables that have been sent.
13
  *
@@ -15,18 +29,56 @@ class MailFake implements Mailer
15
  */
16
  protected $mailables = [];
17
 
 
 
 
 
 
 
 
18
  /**
19
  * Assert if a mailable was sent based on a truth-test callback.
20
  *
21
- * @param string $mailable
22
- * @param callable|null $callback
23
  * @return void
24
  */
25
  public function assertSent($mailable, $callback = null)
26
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  PHPUnit::assertTrue(
28
  $this->sent($mailable, $callback)->count() > 0,
29
- "The expected [{$mailable}] mailable was not sent."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  );
31
  }
32
 
@@ -39,8 +91,8 @@ class MailFake implements Mailer
39
  */
40
  public function assertNotSent($mailable, $callback = null)
41
  {
42
- PHPUnit::assertTrue(
43
- $this->sent($mailable, $callback)->count() === 0,
44
  "The unexpected [{$mailable}] mailable was sent."
45
  );
46
  }
@@ -52,7 +104,80 @@ class MailFake implements Mailer
52
  */
53
  public function assertNothingSent()
54
  {
55
- PHPUnit::assertEmpty($this->mailables, 'Mailables were sent unexpectedly.');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
  /**
@@ -88,6 +213,39 @@ class MailFake implements Mailer
88
  return $this->mailablesOf($mailable)->count() > 0;
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  /**
92
  * Get all of the mailed mailables for a given type.
93
  *
@@ -101,6 +259,32 @@ class MailFake implements Mailer
101
  });
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  * Begin the process of mailing a mailable class instance.
106
  *
@@ -124,11 +308,11 @@ class MailFake implements Mailer
124
  }
125
 
126
  /**
127
- * Send a new message when only a raw text part.
128
  *
129
  * @param string $text
130
  * @param \Closure|string $callback
131
- * @return int
132
  */
133
  public function raw($text, $callback)
134
  {
@@ -138,9 +322,9 @@ class MailFake implements Mailer
138
  /**
139
  * Send a new message using a view.
140
  *
141
- * @param string|array $view
142
  * @param array $data
143
- * @param \Closure|string $callback
144
  * @return void
145
  */
146
  public function send($view, array $data = [], $callback = null)
@@ -149,21 +333,48 @@ class MailFake implements Mailer
149
  return;
150
  }
151
 
 
 
 
 
 
 
 
 
152
  $this->mailables[] = $view;
153
  }
154
 
155
  /**
156
  * Queue a new e-mail message for sending.
157
  *
158
- * @param string|array $view
159
- * @param array $data
160
- * @param \Closure|string $callback
161
  * @param string|null $queue
162
  * @return mixed
163
  */
164
- public function queue($view, array $data = [], $callback = null, $queue = null)
165
  {
166
- $this->send($view);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  }
168
 
169
  /**
@@ -173,6 +384,6 @@ class MailFake implements Mailer
173
  */
174
  public function failures()
175
  {
176
- //
177
  }
178
  }
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
+ use Closure;
6
+ use Illuminate\Contracts\Mail\Factory;
7
  use Illuminate\Contracts\Mail\Mailable;
8
+ use Illuminate\Contracts\Mail\Mailer;
9
+ use Illuminate\Contracts\Mail\MailQueue;
10
+ use Illuminate\Contracts\Queue\ShouldQueue;
11
+ use Illuminate\Support\Traits\ReflectsClosures;
12
  use PHPUnit\Framework\Assert as PHPUnit;
13
 
14
+ class MailFake implements Factory, Mailer, MailQueue
15
  {
16
+ use ReflectsClosures;
17
+
18
+ /**
19
+ * The mailer currently being used to send a message.
20
+ *
21
+ * @var string
22
+ */
23
+ protected $currentMailer;
24
+
25
  /**
26
  * All of the mailables that have been sent.
27
  *
29
  */
30
  protected $mailables = [];
31
 
32
+ /**
33
+ * All of the mailables that have been queued.
34
+ *
35
+ * @var array
36
+ */
37
+ protected $queuedMailables = [];
38
+
39
  /**
40
  * Assert if a mailable was sent based on a truth-test callback.
41
  *
42
+ * @param string|\Closure $mailable
43
+ * @param callable|int|null $callback
44
  * @return void
45
  */
46
  public function assertSent($mailable, $callback = null)
47
  {
48
+ if ($mailable instanceof Closure) {
49
+ [$mailable, $callback] = [$this->firstClosureParameterType($mailable), $mailable];
50
+ }
51
+
52
+ if (is_numeric($callback)) {
53
+ return $this->assertSentTimes($mailable, $callback);
54
+ }
55
+
56
+ $message = "The expected [{$mailable}] mailable was not sent.";
57
+
58
+ if (count($this->queuedMailables) > 0) {
59
+ $message .= ' Did you mean to use assertQueued() instead?';
60
+ }
61
+
62
  PHPUnit::assertTrue(
63
  $this->sent($mailable, $callback)->count() > 0,
64
+ $message
65
+ );
66
+ }
67
+
68
+ /**
69
+ * Assert if a mailable was sent a number of times.
70
+ *
71
+ * @param string $mailable
72
+ * @param int $times
73
+ * @return void
74
+ */
75
+ protected function assertSentTimes($mailable, $times = 1)
76
+ {
77
+ $count = $this->sent($mailable)->count();
78
+
79
+ PHPUnit::assertSame(
80
+ $times, $count,
81
+ "The expected [{$mailable}] mailable was sent {$count} times instead of {$times} times."
82
  );
83
  }
84
 
91
  */
92
  public function assertNotSent($mailable, $callback = null)
93
  {
94
+ PHPUnit::assertCount(
95
+ 0, $this->sent($mailable, $callback),
96
  "The unexpected [{$mailable}] mailable was sent."
97
  );
98
  }
104
  */
105
  public function assertNothingSent()
106
  {
107
+ $mailableNames = collect($this->mailables)->map(function ($mailable) {
108
+ return get_class($mailable);
109
+ })->join(', ');
110
+
111
+ PHPUnit::assertEmpty($this->mailables, 'The following mailables were sent unexpectedly: '.$mailableNames);
112
+ }
113
+
114
+ /**
115
+ * Assert if a mailable was queued based on a truth-test callback.
116
+ *
117
+ * @param string|\Closure $mailable
118
+ * @param callable|int|null $callback
119
+ * @return void
120
+ */
121
+ public function assertQueued($mailable, $callback = null)
122
+ {
123
+ if ($mailable instanceof Closure) {
124
+ [$mailable, $callback] = [$this->firstClosureParameterType($mailable), $mailable];
125
+ }
126
+
127
+ if (is_numeric($callback)) {
128
+ return $this->assertQueuedTimes($mailable, $callback);
129
+ }
130
+
131
+ PHPUnit::assertTrue(
132
+ $this->queued($mailable, $callback)->count() > 0,
133
+ "The expected [{$mailable}] mailable was not queued."
134
+ );
135
+ }
136
+
137
+ /**
138
+ * Assert if a mailable was queued a number of times.
139
+ *
140
+ * @param string $mailable
141
+ * @param int $times
142
+ * @return void
143
+ */
144
+ protected function assertQueuedTimes($mailable, $times = 1)
145
+ {
146
+ $count = $this->queued($mailable)->count();
147
+
148
+ PHPUnit::assertSame(
149
+ $times, $count,
150
+ "The expected [{$mailable}] mailable was queued {$count} times instead of {$times} times."
151
+ );
152
+ }
153
+
154
+ /**
155
+ * Determine if a mailable was not queued based on a truth-test callback.
156
+ *
157
+ * @param string $mailable
158
+ * @param callable|null $callback
159
+ * @return void
160
+ */
161
+ public function assertNotQueued($mailable, $callback = null)
162
+ {
163
+ PHPUnit::assertCount(
164
+ 0, $this->queued($mailable, $callback),
165
+ "The unexpected [{$mailable}] mailable was queued."
166
+ );
167
+ }
168
+
169
+ /**
170
+ * Assert that no mailables were queued.
171
+ *
172
+ * @return void
173
+ */
174
+ public function assertNothingQueued()
175
+ {
176
+ $mailableNames = collect($this->queuedMailables)->map(function ($mailable) {
177
+ return get_class($mailable);
178
+ })->join(', ');
179
+
180
+ PHPUnit::assertEmpty($this->queuedMailables, 'The following mailables were queued unexpectedly: '.$mailableNames);
181
  }
182
 
183
  /**
213
  return $this->mailablesOf($mailable)->count() > 0;
214
  }
215
 
216
+ /**
217
+ * Get all of the queued mailables matching a truth-test callback.
218
+ *
219
+ * @param string $mailable
220
+ * @param callable|null $callback
221
+ * @return \Illuminate\Support\Collection
222
+ */
223
+ public function queued($mailable, $callback = null)
224
+ {
225
+ if (! $this->hasQueued($mailable)) {
226
+ return collect();
227
+ }
228
+
229
+ $callback = $callback ?: function () {
230
+ return true;
231
+ };
232
+
233
+ return $this->queuedMailablesOf($mailable)->filter(function ($mailable) use ($callback) {
234
+ return $callback($mailable);
235
+ });
236
+ }
237
+
238
+ /**
239
+ * Determine if the given mailable has been queued.
240
+ *
241
+ * @param string $mailable
242
+ * @return bool
243
+ */
244
+ public function hasQueued($mailable)
245
+ {
246
+ return $this->queuedMailablesOf($mailable)->count() > 0;
247
+ }
248
+
249
  /**
250
  * Get all of the mailed mailables for a given type.
251
  *
259
  });
260
  }
261
 
262
+ /**
263
+ * Get all of the mailed mailables for a given type.
264
+ *
265
+ * @param string $type
266
+ * @return \Illuminate\Support\Collection
267
+ */
268
+ protected function queuedMailablesOf($type)
269
+ {
270
+ return collect($this->queuedMailables)->filter(function ($mailable) use ($type) {
271
+ return $mailable instanceof $type;
272
+ });
273
+ }
274
+
275
+ /**
276
+ * Get a mailer instance by name.
277
+ *
278
+ * @param string|null $name
279
+ * @return \Illuminate\Contracts\Mail\Mailer
280
+ */
281
+ public function mailer($name = null)
282
+ {
283
+ $this->currentMailer = $name;
284
+
285
+ return $this;
286
+ }
287
+
288
  /**
289
  * Begin the process of mailing a mailable class instance.
290
  *
308
  }
309
 
310
  /**
311
+ * Send a new message with only a raw text part.
312
  *
313
  * @param string $text
314
  * @param \Closure|string $callback
315
+ * @return void
316
  */
317
  public function raw($text, $callback)
318
  {
322
  /**
323
  * Send a new message using a view.
324
  *
325
+ * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
326
  * @param array $data
327
+ * @param \Closure|string|null $callback
328
  * @return void
329
  */
330
  public function send($view, array $data = [], $callback = null)
333
  return;
334
  }
335
 
336
+ $view->mailer($this->currentMailer);
337
+
338
+ $this->currentMailer = null;
339
+
340
+ if ($view instanceof ShouldQueue) {
341
+ return $this->queue($view, $data);
342
+ }
343
+
344
  $this->mailables[] = $view;
345
  }
346
 
347
  /**
348
  * Queue a new e-mail message for sending.
349
  *
350
+ * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
 
 
351
  * @param string|null $queue
352
  * @return mixed
353
  */
354
+ public function queue($view, $queue = null)
355
  {
356
+ if (! $view instanceof Mailable) {
357
+ return;
358
+ }
359
+
360
+ $view->mailer($this->currentMailer);
361
+
362
+ $this->currentMailer = null;
363
+
364
+ $this->queuedMailables[] = $view;
365
+ }
366
+
367
+ /**
368
+ * Queue a new e-mail message for sending after (n) seconds.
369
+ *
370
+ * @param \DateTimeInterface|\DateInterval|int $delay
371
+ * @param \Illuminate\Contracts\Mail\Mailable|string|array $view
372
+ * @param string|null $queue
373
+ * @return mixed
374
+ */
375
+ public function later($delay, $view, $queue = null)
376
+ {
377
+ $this->queue($view, $queue);
378
  }
379
 
380
  /**
384
  */
385
  public function failures()
386
  {
387
+ return [];
388
  }
389
  }
vendor/illuminate/support/Testing/Fakes/NotificationFake.php CHANGED
@@ -2,13 +2,21 @@
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
- use Ramsey\Uuid\Uuid;
 
 
 
 
6
  use Illuminate\Support\Collection;
 
 
 
7
  use PHPUnit\Framework\Assert as PHPUnit;
8
- use Illuminate\Contracts\Notifications\Factory as NotificationFactory;
9
 
10
- class NotificationFake implements NotificationFactory
11
  {
 
 
12
  /**
13
  * All of the notifications that have been sent.
14
  *
@@ -16,17 +24,30 @@ class NotificationFake implements NotificationFactory
16
  */
17
  protected $notifications = [];
18
 
 
 
 
 
 
 
 
19
  /**
20
  * Assert if a notification was sent based on a truth-test callback.
21
  *
22
  * @param mixed $notifiable
23
- * @param string $notification
24
  * @param callable|null $callback
25
  * @return void
 
 
26
  */
27
  public function assertSentTo($notifiable, $notification, $callback = null)
28
  {
29
  if (is_array($notifiable) || $notifiable instanceof Collection) {
 
 
 
 
30
  foreach ($notifiable as $singleNotifiable) {
31
  $this->assertSentTo($singleNotifiable, $notification, $callback);
32
  }
@@ -34,6 +55,14 @@ class NotificationFake implements NotificationFactory
34
  return;
35
  }
36
 
 
 
 
 
 
 
 
 
37
  PHPUnit::assertTrue(
38
  $this->sent($notifiable, $notification, $callback)->count() > 0,
39
  "The expected [{$notification}] notification was not sent."
@@ -41,16 +70,40 @@ class NotificationFake implements NotificationFactory
41
  }
42
 
43
  /**
44
- * Determine if a notification was sent based on a truth-test callback.
45
  *
46
  * @param mixed $notifiable
47
  * @param string $notification
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  * @param callable|null $callback
49
  * @return void
 
 
50
  */
51
  public function assertNotSentTo($notifiable, $notification, $callback = null)
52
  {
53
  if (is_array($notifiable) || $notifiable instanceof Collection) {
 
 
 
 
54
  foreach ($notifiable as $singleNotifiable) {
55
  $this->assertNotSentTo($singleNotifiable, $notification, $callback);
56
  }
@@ -58,12 +111,47 @@ class NotificationFake implements NotificationFactory
58
  return;
59
  }
60
 
61
- PHPUnit::assertTrue(
62
- $this->sent($notifiable, $notification, $callback)->count() === 0,
 
 
 
 
63
  "The unexpected [{$notification}] notification was sent."
64
  );
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  /**
68
  * Get all of the notifications matching a truth-test callback.
69
  *
@@ -110,11 +198,7 @@ class NotificationFake implements NotificationFactory
110
  */
111
  protected function notificationsFor($notifiable, $notification)
112
  {
113
- if (isset($this->notifications[get_class($notifiable)][$notifiable->getKey()][$notification])) {
114
- return $this->notifications[get_class($notifiable)][$notifiable->getKey()][$notification];
115
- }
116
-
117
- return [];
118
  }
119
 
120
  /**
@@ -126,7 +210,7 @@ class NotificationFake implements NotificationFactory
126
  */
127
  public function send($notifiables, $notification)
128
  {
129
- return $this->sendNow($notifiables, $notification);
130
  }
131
 
132
  /**
@@ -134,20 +218,29 @@ class NotificationFake implements NotificationFactory
134
  *
135
  * @param \Illuminate\Support\Collection|array|mixed $notifiables
136
  * @param mixed $notification
 
137
  * @return void
138
  */
139
- public function sendNow($notifiables, $notification)
140
  {
141
  if (! $notifiables instanceof Collection && ! is_array($notifiables)) {
142
  $notifiables = [$notifiables];
143
  }
144
 
145
  foreach ($notifiables as $notifiable) {
146
- $notification->id = Uuid::uuid4()->toString();
 
 
147
 
148
  $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [
149
  'notification' => $notification,
150
- 'channels' => $notification->via($notifiable),
 
 
 
 
 
 
151
  ];
152
  }
153
  }
@@ -162,4 +255,17 @@ class NotificationFake implements NotificationFactory
162
  {
163
  //
164
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
+ use Closure;
6
+ use Exception;
7
+ use Illuminate\Contracts\Notifications\Dispatcher as NotificationDispatcher;
8
+ use Illuminate\Contracts\Notifications\Factory as NotificationFactory;
9
+ use Illuminate\Contracts\Translation\HasLocalePreference;
10
  use Illuminate\Support\Collection;
11
+ use Illuminate\Support\Str;
12
+ use Illuminate\Support\Traits\Macroable;
13
+ use Illuminate\Support\Traits\ReflectsClosures;
14
  use PHPUnit\Framework\Assert as PHPUnit;
 
15
 
16
+ class NotificationFake implements NotificationDispatcher, NotificationFactory
17
  {
18
+ use Macroable, ReflectsClosures;
19
+
20
  /**
21
  * All of the notifications that have been sent.
22
  *
24
  */
25
  protected $notifications = [];
26
 
27
+ /**
28
+ * Locale used when sending notifications.
29
+ *
30
+ * @var string|null
31
+ */
32
+ public $locale;
33
+
34
  /**
35
  * Assert if a notification was sent based on a truth-test callback.
36
  *
37
  * @param mixed $notifiable
38
+ * @param string|\Closure $notification
39
  * @param callable|null $callback
40
  * @return void
41
+ *
42
+ * @throws \Exception
43
  */
44
  public function assertSentTo($notifiable, $notification, $callback = null)
45
  {
46
  if (is_array($notifiable) || $notifiable instanceof Collection) {
47
+ if (count($notifiable) === 0) {
48
+ throw new Exception('No notifiable given.');
49
+ }
50
+
51
  foreach ($notifiable as $singleNotifiable) {
52
  $this->assertSentTo($singleNotifiable, $notification, $callback);
53
  }
55
  return;
56
  }
57
 
58
+ if ($notification instanceof Closure) {
59
+ [$notification, $callback] = [$this->firstClosureParameterType($notification), $notification];
60
+ }
61
+
62
+ if (is_numeric($callback)) {
63
+ return $this->assertSentToTimes($notifiable, $notification, $callback);
64
+ }
65
+
66
  PHPUnit::assertTrue(
67
  $this->sent($notifiable, $notification, $callback)->count() > 0,
68
  "The expected [{$notification}] notification was not sent."
70
  }
71
 
72
  /**
73
+ * Assert if a notification was sent a number of times.
74
  *
75
  * @param mixed $notifiable
76
  * @param string $notification
77
+ * @param int $times
78
+ * @return void
79
+ */
80
+ public function assertSentToTimes($notifiable, $notification, $times = 1)
81
+ {
82
+ $count = $this->sent($notifiable, $notification)->count();
83
+
84
+ PHPUnit::assertSame(
85
+ $times, $count,
86
+ "Expected [{$notification}] to be sent {$times} times, but was sent {$count} times."
87
+ );
88
+ }
89
+
90
+ /**
91
+ * Determine if a notification was sent based on a truth-test callback.
92
+ *
93
+ * @param mixed $notifiable
94
+ * @param string|\Closure $notification
95
  * @param callable|null $callback
96
  * @return void
97
+ *
98
+ * @throws \Exception
99
  */
100
  public function assertNotSentTo($notifiable, $notification, $callback = null)
101
  {
102
  if (is_array($notifiable) || $notifiable instanceof Collection) {
103
+ if (count($notifiable) === 0) {
104
+ throw new Exception('No notifiable given.');
105
+ }
106
+
107
  foreach ($notifiable as $singleNotifiable) {
108
  $this->assertNotSentTo($singleNotifiable, $notification, $callback);
109
  }
111
  return;
112
  }
113
 
114
+ if ($notification instanceof Closure) {
115
+ [$notification, $callback] = [$this->firstClosureParameterType($notification), $notification];
116
+ }
117
+
118
+ PHPUnit::assertCount(
119
+ 0, $this->sent($notifiable, $notification, $callback),
120
  "The unexpected [{$notification}] notification was sent."
121
  );
122
  }
123
 
124
+ /**
125
+ * Assert that no notifications were sent.
126
+ *
127
+ * @return void
128
+ */
129
+ public function assertNothingSent()
130
+ {
131
+ PHPUnit::assertEmpty($this->notifications, 'Notifications were sent unexpectedly.');
132
+ }
133
+
134
+ /**
135
+ * Assert the total amount of times a notification was sent.
136
+ *
137
+ * @param int $expectedCount
138
+ * @param string $notification
139
+ * @return void
140
+ */
141
+ public function assertTimesSent($expectedCount, $notification)
142
+ {
143
+ $actualCount = collect($this->notifications)
144
+ ->flatten(1)
145
+ ->reduce(function ($count, $sent) use ($notification) {
146
+ return $count + count($sent[$notification] ?? []);
147
+ }, 0);
148
+
149
+ PHPUnit::assertSame(
150
+ $expectedCount, $actualCount,
151
+ "Expected [{$notification}] to be sent {$expectedCount} times, but was sent {$actualCount} times."
152
+ );
153
+ }
154
+
155
  /**
156
  * Get all of the notifications matching a truth-test callback.
157
  *
198
  */
199
  protected function notificationsFor($notifiable, $notification)
200
  {
201
+ return $this->notifications[get_class($notifiable)][$notifiable->getKey()][$notification] ?? [];
 
 
 
 
202
  }
203
 
204
  /**
210
  */
211
  public function send($notifiables, $notification)
212
  {
213
+ $this->sendNow($notifiables, $notification);
214
  }
215
 
216
  /**
218
  *
219
  * @param \Illuminate\Support\Collection|array|mixed $notifiables
220
  * @param mixed $notification
221
+ * @param array|null $channels
222
  * @return void
223
  */
224
+ public function sendNow($notifiables, $notification, array $channels = null)
225
  {
226
  if (! $notifiables instanceof Collection && ! is_array($notifiables)) {
227
  $notifiables = [$notifiables];
228
  }
229
 
230
  foreach ($notifiables as $notifiable) {
231
+ if (! $notification->id) {
232
+ $notification->id = Str::uuid()->toString();
233
+ }
234
 
235
  $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [
236
  'notification' => $notification,
237
+ 'channels' => $channels ?: $notification->via($notifiable),
238
+ 'notifiable' => $notifiable,
239
+ 'locale' => $notification->locale ?? $this->locale ?? value(function () use ($notifiable) {
240
+ if ($notifiable instanceof HasLocalePreference) {
241
+ return $notifiable->preferredLocale();
242
+ }
243
+ }),
244
  ];
245
  }
246
  }
255
  {
256
  //
257
  }
258
+
259
+ /**
260
+ * Set the locale of notifications.
261
+ *
262
+ * @param string $locale
263
+ * @return $this
264
+ */
265
+ public function locale($locale)
266
+ {
267
+ $this->locale = $locale;
268
+
269
+ return $this;
270
+ }
271
  }
vendor/illuminate/support/Testing/Fakes/PendingBatchFake.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Testing\Fakes;
4
+
5
+ use Illuminate\Bus\PendingBatch;
6
+ use Illuminate\Support\Collection;
7
+
8
+ class PendingBatchFake extends PendingBatch
9
+ {
10
+ /**
11
+ * The fake bus instance.
12
+ *
13
+ * @var \Illuminate\Support\Testing\Fakes\BusFake
14
+ */
15
+ protected $bus;
16
+
17
+ /**
18
+ * Create a new pending batch instance.
19
+ *
20
+ * @param \Illuminate\Support\Testing\Fakes\BusFake $bus
21
+ * @param \Illuminate\Support\Collection $jobs
22
+ * @return void
23
+ */
24
+ public function __construct(BusFake $bus, Collection $jobs)
25
+ {
26
+ $this->bus = $bus;
27
+ $this->jobs = $jobs;
28
+ }
29
+
30
+ /**
31
+ * Dispatch the batch.
32
+ *
33
+ * @return \Illuminate\Bus\Batch
34
+ */
35
+ public function dispatch()
36
+ {
37
+ return $this->bus->recordPendingBatch($this);
38
+ }
39
+ }
vendor/illuminate/support/Testing/Fakes/PendingChainFake.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Testing\Fakes;
4
+
5
+ use Closure;
6
+ use Illuminate\Foundation\Bus\PendingChain;
7
+ use Illuminate\Queue\CallQueuedClosure;
8
+
9
+ class PendingChainFake extends PendingChain
10
+ {
11
+ /**
12
+ * The fake bus instance.
13
+ *
14
+ * @var \Illuminate\Support\Testing\Fakes\BusFake
15
+ */
16
+ protected $bus;
17
+
18
+ /**
19
+ * Create a new pending chain instance.
20
+ *
21
+ * @param \Illuminate\Support\Testing\Fakes\BusFake $bus
22
+ * @param mixed $job
23
+ * @param array $chain
24
+ * @return void
25
+ */
26
+ public function __construct(BusFake $bus, $job, $chain)
27
+ {
28
+ $this->bus = $bus;
29
+ $this->job = $job;
30
+ $this->chain = $chain;
31
+ }
32
+
33
+ /**
34
+ * Dispatch the job with the given arguments.
35
+ *
36
+ * @return \Illuminate\Foundation\Bus\PendingDispatch
37
+ */
38
+ public function dispatch()
39
+ {
40
+ if (is_string($this->job)) {
41
+ $firstJob = new $this->job(...func_get_args());
42
+ } elseif ($this->job instanceof Closure) {
43
+ $firstJob = CallQueuedClosure::create($this->job);
44
+ } else {
45
+ $firstJob = $this->job;
46
+ }
47
+
48
+ $firstJob->allOnConnection($this->connection);
49
+ $firstJob->allOnQueue($this->queue);
50
+ $firstJob->chain($this->chain);
51
+ $firstJob->delay($this->delay);
52
+ $firstJob->chainCatchCallbacks = $this->catchCallbacks();
53
+
54
+ return $this->bus->dispatch($firstJob);
55
+ }
56
+ }
vendor/illuminate/support/Testing/Fakes/PendingMailFake.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
- use Illuminate\Mail\Mailable;
6
  use Illuminate\Mail\PendingMail;
7
 
8
  class PendingMailFake extends PendingMail
@@ -21,21 +21,10 @@ class PendingMailFake extends PendingMail
21
  /**
22
  * Send a new mailable message instance.
23
  *
24
- * @param Mailable $mailable
25
- * @return mixed
26
  */
27
  public function send(Mailable $mailable)
28
- {
29
- return $this->sendNow($mailable);
30
- }
31
-
32
- /**
33
- * Send a mailable message immediately.
34
- *
35
- * @param Mailable $mailable
36
- * @return mixed
37
- */
38
- public function sendNow(Mailable $mailable)
39
  {
40
  $this->mailer->send($this->fill($mailable));
41
  }
@@ -43,11 +32,11 @@ class PendingMailFake extends PendingMail
43
  /**
44
  * Push the given mailable onto the queue.
45
  *
46
- * @param Mailable $mailable
47
  * @return mixed
48
  */
49
  public function queue(Mailable $mailable)
50
  {
51
- return $this->sendNow($mailable);
52
  }
53
  }
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
+ use Illuminate\Contracts\Mail\Mailable;
6
  use Illuminate\Mail\PendingMail;
7
 
8
  class PendingMailFake extends PendingMail
21
  /**
22
  * Send a new mailable message instance.
23
  *
24
+ * @param \Illuminate\Contracts\Mail\Mailable $mailable
25
+ * @return void
26
  */
27
  public function send(Mailable $mailable)
 
 
 
 
 
 
 
 
 
 
 
28
  {
29
  $this->mailer->send($this->fill($mailable));
30
  }
32
  /**
33
  * Push the given mailable onto the queue.
34
  *
35
+ * @param \Illuminate\Contracts\Mail\Mailable $mailable
36
  * @return mixed
37
  */
38
  public function queue(Mailable $mailable)
39
  {
40
+ return $this->mailer->queue($this->fill($mailable));
41
  }
42
  }
vendor/illuminate/support/Testing/Fakes/QueueFake.php CHANGED
@@ -2,12 +2,17 @@
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
- use Illuminate\Queue\QueueManager;
 
6
  use Illuminate\Contracts\Queue\Queue;
 
 
7
  use PHPUnit\Framework\Assert as PHPUnit;
8
 
9
  class QueueFake extends QueueManager implements Queue
10
  {
 
 
11
  /**
12
  * All of the jobs that have been pushed.
13
  *
@@ -18,29 +23,58 @@ class QueueFake extends QueueManager implements Queue
18
  /**
19
  * Assert if a job was pushed based on a truth-test callback.
20
  *
21
- * @param string $job
22
- * @param callable|null $callback
23
  * @return void
24
  */
25
  public function assertPushed($job, $callback = null)
26
  {
 
 
 
 
 
 
 
 
27
  PHPUnit::assertTrue(
28
  $this->pushed($job, $callback)->count() > 0,
29
  "The expected [{$job}] job was not pushed."
30
  );
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * Assert if a job was pushed based on a truth-test callback.
35
  *
36
  * @param string $queue
37
- * @param string $job
38
  * @param callable|null $callback
39
  * @return void
40
  */
41
  public function assertPushedOn($queue, $job, $callback = null)
42
  {
43
- return $this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) {
 
 
 
 
44
  if ($pushedQueue !== $queue) {
45
  return false;
46
  }
@@ -50,20 +84,134 @@ class QueueFake extends QueueManager implements Queue
50
  }
51
 
52
  /**
53
- * Determine if a job was pushed based on a truth-test callback.
54
  *
55
  * @param string $job
 
56
  * @param callable|null $callback
57
  * @return void
58
  */
59
- public function assertNotPushed($job, $callback = null)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  {
 
 
 
 
 
 
 
 
61
  PHPUnit::assertTrue(
62
- $this->pushed($job, $callback)->count() === 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  "The unexpected [{$job}] job was pushed."
64
  );
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
67
  /**
68
  * Get all of the jobs matching a truth-test callback.
69
  *
@@ -111,20 +259,22 @@ class QueueFake extends QueueManager implements Queue
111
  /**
112
  * Get the size of the queue.
113
  *
114
- * @param string $queue
115
  * @return int
116
  */
117
  public function size($queue = null)
118
  {
119
- return 0;
 
 
120
  }
121
 
122
  /**
123
  * Push a new job onto the queue.
124
  *
125
  * @param string $job
126
- * @param mixed $data
127
- * @param string $queue
128
  * @return mixed
129
  */
130
  public function push($job, $data = '', $queue = null)
@@ -139,8 +289,8 @@ class QueueFake extends QueueManager implements Queue
139
  * Push a raw payload onto the queue.
140
  *
141
  * @param string $payload
142
- * @param string $queue
143
- * @param array $options
144
  * @return mixed
145
  */
146
  public function pushRaw($payload, $queue = null, array $options = [])
@@ -151,10 +301,10 @@ class QueueFake extends QueueManager implements Queue
151
  /**
152
  * Push a new job onto the queue after a delay.
153
  *
154
- * @param \DateTime|int $delay
155
  * @param string $job
156
- * @param mixed $data
157
- * @param string $queue
158
  * @return mixed
159
  */
160
  public function later($delay, $job, $data = '', $queue = null)
@@ -167,7 +317,7 @@ class QueueFake extends QueueManager implements Queue
167
  *
168
  * @param string $queue
169
  * @param string $job
170
- * @param mixed $data
171
  * @return mixed
172
  */
173
  public function pushOn($queue, $job, $data = '')
@@ -179,9 +329,9 @@ class QueueFake extends QueueManager implements Queue
179
  * Push a new job onto the queue after a delay.
180
  *
181
  * @param string $queue
182
- * @param \DateTime|int $delay
183
  * @param string $job
184
- * @param mixed $data
185
  * @return mixed
186
  */
187
  public function laterOn($queue, $delay, $job, $data = '')
@@ -192,7 +342,7 @@ class QueueFake extends QueueManager implements Queue
192
  /**
193
  * Pop the next job off of the queue.
194
  *
195
- * @param string $queue
196
  * @return \Illuminate\Contracts\Queue\Job|null
197
  */
198
  public function pop($queue = null)
@@ -203,18 +353,28 @@ class QueueFake extends QueueManager implements Queue
203
  /**
204
  * Push an array of jobs onto the queue.
205
  *
206
- * @param array $jobs
207
- * @param mixed $data
208
- * @param string $queue
209
  * @return mixed
210
  */
211
  public function bulk($jobs, $data = '', $queue = null)
212
  {
213
- foreach ($this->jobs as $job) {
214
- $this->push($job);
215
  }
216
  }
217
 
 
 
 
 
 
 
 
 
 
 
218
  /**
219
  * Get the connection name for the queue.
220
  *
@@ -228,11 +388,27 @@ class QueueFake extends QueueManager implements Queue
228
  /**
229
  * Set the connection name for the queue.
230
  *
231
- * @param string $name
232
  * @return $this
233
  */
234
  public function setConnectionName($name)
235
  {
236
  return $this;
237
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
2
 
3
  namespace Illuminate\Support\Testing\Fakes;
4
 
5
+ use BadMethodCallException;
6
+ use Closure;
7
  use Illuminate\Contracts\Queue\Queue;
8
+ use Illuminate\Queue\QueueManager;
9
+ use Illuminate\Support\Traits\ReflectsClosures;
10
  use PHPUnit\Framework\Assert as PHPUnit;
11
 
12
  class QueueFake extends QueueManager implements Queue
13
  {
14
+ use ReflectsClosures;
15
+
16
  /**
17
  * All of the jobs that have been pushed.
18
  *
23
  /**
24
  * Assert if a job was pushed based on a truth-test callback.
25
  *
26
+ * @param string|\Closure $job
27
+ * @param callable|int|null $callback
28
  * @return void
29
  */
30
  public function assertPushed($job, $callback = null)
31
  {
32
+ if ($job instanceof Closure) {
33
+ [$job, $callback] = [$this->firstClosureParameterType($job), $job];
34
+ }
35
+
36
+ if (is_numeric($callback)) {
37
+ return $this->assertPushedTimes($job, $callback);
38
+ }
39
+
40
  PHPUnit::assertTrue(
41
  $this->pushed($job, $callback)->count() > 0,
42
  "The expected [{$job}] job was not pushed."
43
  );
44
  }
45
 
46
+ /**
47
+ * Assert if a job was pushed a number of times.
48
+ *
49
+ * @param string $job
50
+ * @param int $times
51
+ * @return void
52
+ */
53
+ protected function assertPushedTimes($job, $times = 1)
54
+ {
55
+ $count = $this->pushed($job)->count();
56
+
57
+ PHPUnit::assertSame(
58
+ $times, $count,
59
+ "The expected [{$job}] job was pushed {$count} times instead of {$times} times."
60
+ );
61
+ }
62
+
63
  /**
64
  * Assert if a job was pushed based on a truth-test callback.
65
  *
66
  * @param string $queue
67
+ * @param string|\Closure $job
68
  * @param callable|null $callback
69
  * @return void
70
  */
71
  public function assertPushedOn($queue, $job, $callback = null)
72
  {
73
+ if ($job instanceof Closure) {
74
+ [$job, $callback] = [$this->firstClosureParameterType($job), $job];
75
+ }
76
+
77
+ $this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) {
78
  if ($pushedQueue !== $queue) {
79
  return false;
80
  }
84
  }
85
 
86
  /**
87
+ * Assert if a job was pushed with chained jobs based on a truth-test callback.
88
  *
89
  * @param string $job
90
+ * @param array $expectedChain
91
  * @param callable|null $callback
92
  * @return void
93
  */
94
+ public function assertPushedWithChain($job, $expectedChain = [], $callback = null)
95
+ {
96
+ PHPUnit::assertTrue(
97
+ $this->pushed($job, $callback)->isNotEmpty(),
98
+ "The expected [{$job}] job was not pushed."
99
+ );
100
+
101
+ PHPUnit::assertTrue(
102
+ collect($expectedChain)->isNotEmpty(),
103
+ 'The expected chain can not be empty.'
104
+ );
105
+
106
+ $this->isChainOfObjects($expectedChain)
107
+ ? $this->assertPushedWithChainOfObjects($job, $expectedChain, $callback)
108
+ : $this->assertPushedWithChainOfClasses($job, $expectedChain, $callback);
109
+ }
110
+
111
+ /**
112
+ * Assert if a job was pushed with an empty chain based on a truth-test callback.
113
+ *
114
+ * @param string $job
115
+ * @param callable|null $callback
116
+ * @return void
117
+ */
118
+ public function assertPushedWithoutChain($job, $callback = null)
119
+ {
120
+ PHPUnit::assertTrue(
121
+ $this->pushed($job, $callback)->isNotEmpty(),
122
+ "The expected [{$job}] job was not pushed."
123
+ );
124
+
125
+ $this->assertPushedWithChainOfClasses($job, [], $callback);
126
+ }
127
+
128
+ /**
129
+ * Assert if a job was pushed with chained jobs based on a truth-test callback.
130
+ *
131
+ * @param string $job
132
+ * @param array $expectedChain
133
+ * @param callable|null $callback
134
+ * @return void
135
+ */
136
+ protected function assertPushedWithChainOfObjects($job, $expectedChain, $callback)
137
+ {
138
+ $chain = collect($expectedChain)->map(function ($job) {
139
+ return serialize($job);
140
+ })->all();
141
+
142
+ PHPUnit::assertTrue(
143
+ $this->pushed($job, $callback)->filter(function ($job) use ($chain) {
144
+ return $job->chained == $chain;
145
+ })->isNotEmpty(),
146
+ 'The expected chain was not pushed.'
147
+ );
148
+ }
149
+
150
+ /**
151
+ * Assert if a job was pushed with chained jobs based on a truth-test callback.
152
+ *
153
+ * @param string $job
154
+ * @param array $expectedChain
155
+ * @param callable|null $callback
156
+ * @return void
157
+ */
158
+ protected function assertPushedWithChainOfClasses($job, $expectedChain, $callback)
159
  {
160
+ $matching = $this->pushed($job, $callback)->map->chained->map(function ($chain) {
161
+ return collect($chain)->map(function ($job) {
162
+ return get_class(unserialize($job));
163
+ });
164
+ })->filter(function ($chain) use ($expectedChain) {
165
+ return $chain->all() === $expectedChain;
166
+ });
167
+
168
  PHPUnit::assertTrue(
169
+ $matching->isNotEmpty(), 'The expected chain was not pushed.'
170
+ );
171
+ }
172
+
173
+ /**
174
+ * Determine if the given chain is entirely composed of objects.
175
+ *
176
+ * @param array $chain
177
+ * @return bool
178
+ */
179
+ protected function isChainOfObjects($chain)
180
+ {
181
+ return ! collect($chain)->contains(function ($job) {
182
+ return ! is_object($job);
183
+ });
184
+ }
185
+
186
+ /**
187
+ * Determine if a job was pushed based on a truth-test callback.
188
+ *
189
+ * @param string|\Closure $job
190
+ * @param callable|null $callback
191
+ * @return void
192
+ */
193
+ public function assertNotPushed($job, $callback = null)
194
+ {
195
+ if ($job instanceof Closure) {
196
+ [$job, $callback] = [$this->firstClosureParameterType($job), $job];
197
+ }
198
+
199
+ PHPUnit::assertCount(
200
+ 0, $this->pushed($job, $callback),
201
  "The unexpected [{$job}] job was pushed."
202
  );
203
  }
204
 
205
+ /**
206
+ * Assert that no jobs were pushed.
207
+ *
208
+ * @return void
209
+ */
210
+ public function assertNothingPushed()
211
+ {
212
+ PHPUnit::assertEmpty($this->jobs, 'Jobs were pushed unexpectedly.');
213
+ }
214
+
215
  /**
216
  * Get all of the jobs matching a truth-test callback.
217
  *
259
  /**
260
  * Get the size of the queue.
261
  *
262
+ * @param string|null $queue
263
  * @return int
264
  */
265
  public function size($queue = null)
266
  {
267
+ return collect($this->jobs)->flatten(1)->filter(function ($job) use ($queue) {
268
+ return $job['queue'] === $queue;
269
+ })->count();
270
  }
271
 
272
  /**
273
  * Push a new job onto the queue.
274
  *
275
  * @param string $job
276
+ * @param mixed $data
277
+ * @param string|null $queue
278
  * @return mixed
279
  */
280
  public function push($job, $data = '', $queue = null)
289
  * Push a raw payload onto the queue.
290
  *
291
  * @param string $payload
292
+ * @param string|null $queue
293
+ * @param array $options
294
  * @return mixed
295
  */
296
  public function pushRaw($payload, $queue = null, array $options = [])
301
  /**
302
  * Push a new job onto the queue after a delay.
303
  *
304
+ * @param \DateTimeInterface|\DateInterval|int $delay
305
  * @param string $job
306
+ * @param mixed $data
307
+ * @param string|null $queue
308
  * @return mixed
309
  */
310
  public function later($delay, $job, $data = '', $queue = null)
317
  *
318
  * @param string $queue
319
  * @param string $job
320
+ * @param mixed $data
321
  * @return mixed
322
  */
323
  public function pushOn($queue, $job, $data = '')
329
  * Push a new job onto the queue after a delay.
330
  *
331
  * @param string $queue
332
+ * @param \DateTimeInterface|\DateInterval|int $delay
333
  * @param string $job
334
+ * @param mixed $data
335
  * @return mixed
336
  */
337
  public function laterOn($queue, $delay, $job, $data = '')
342
  /**
343
  * Pop the next job off of the queue.
344
  *
345
+ * @param string|null $queue
346
  * @return \Illuminate\Contracts\Queue\Job|null
347
  */
348
  public function pop($queue = null)
353
  /**
354
  * Push an array of jobs onto the queue.
355
  *
356
+ * @param array $jobs
357
+ * @param mixed $data
358
+ * @param string|null $queue
359
  * @return mixed
360
  */
361
  public function bulk($jobs, $data = '', $queue = null)
362
  {
363
+ foreach ($jobs as $job) {
364
+ $this->push($job, $data, $queue);
365
  }
366
  }
367
 
368
+ /**
369
+ * Get the jobs that have been pushed.
370
+ *
371
+ * @return array
372
+ */
373
+ public function pushedJobs()
374
+ {
375
+ return $this->jobs;
376
+ }
377
+
378
  /**
379
  * Get the connection name for the queue.
380
  *
388
  /**
389
  * Set the connection name for the queue.
390
  *
391
+ * @param string $name
392
  * @return $this
393
  */
394
  public function setConnectionName($name)
395
  {
396
  return $this;
397
  }
398
+
399
+ /**
400
+ * Override the QueueManager to prevent circular dependency.
401
+ *
402
+ * @param string $method
403
+ * @param array $parameters
404
+ * @return mixed
405
+ *
406
+ * @throws \BadMethodCallException
407
+ */
408
+ public function __call($method, $parameters)
409
+ {
410
+ throw new BadMethodCallException(sprintf(
411
+ 'Call to undefined method %s::%s()', static::class, $method
412
+ ));
413
+ }
414
  }
vendor/illuminate/support/Traits/CapsuleManagerTrait.php CHANGED
@@ -2,8 +2,8 @@
2
 
3
  namespace Illuminate\Support\Traits;
4
 
5
- use Illuminate\Support\Fluent;
6
  use Illuminate\Contracts\Container\Container;
 
7
 
8
  trait CapsuleManagerTrait
9
  {
2
 
3
  namespace Illuminate\Support\Traits;
4
 
 
5
  use Illuminate\Contracts\Container\Container;
6
+ use Illuminate\Support\Fluent;
7
 
8
  trait CapsuleManagerTrait
9
  {
vendor/illuminate/support/Traits/ForwardsCalls.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Traits;
4
+
5
+ use BadMethodCallException;
6
+ use Error;
7
+
8
+ trait ForwardsCalls
9
+ {
10
+ /**
11
+ * Forward a method call to the given object.
12
+ *
13
+ * @param mixed $object
14
+ * @param string $method
15
+ * @param array $parameters
16
+ * @return mixed
17
+ *
18
+ * @throws \BadMethodCallException
19
+ */
20
+ protected function forwardCallTo($object, $method, $parameters)
21
+ {
22
+ try {
23
+ return $object->{$method}(...$parameters);
24
+ } catch (Error | BadMethodCallException $e) {
25
+ $pattern = '~^Call to undefined method (?P<class>[^:]+)::(?P<method>[^\(]+)\(\)$~';
26
+
27
+ if (! preg_match($pattern, $e->getMessage(), $matches)) {
28
+ throw $e;
29
+ }
30
+
31
+ if ($matches['class'] != get_class($object) ||
32
+ $matches['method'] != $method) {
33
+ throw $e;
34
+ }
35
+
36
+ static::throwBadMethodCallException($method);
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Throw a bad method call exception for the given method.
42
+ *
43
+ * @param string $method
44
+ * @return void
45
+ *
46
+ * @throws \BadMethodCallException
47
+ */
48
+ protected static function throwBadMethodCallException($method)
49
+ {
50
+ throw new BadMethodCallException(sprintf(
51
+ 'Call to undefined method %s::%s()', static::class, $method
52
+ ));
53
+ }
54
+ }
vendor/illuminate/support/Traits/Localizable.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Traits;
4
+
5
+ use Illuminate\Container\Container;
6
+
7
+ trait Localizable
8
+ {
9
+ /**
10
+ * Run the callback with the given locale.
11
+ *
12
+ * @param string $locale
13
+ * @param \Closure $callback
14
+ * @return mixed
15
+ */
16
+ public function withLocale($locale, $callback)
17
+ {
18
+ if (! $locale) {
19
+ return $callback();
20
+ }
21
+
22
+ $app = Container::getInstance();
23
+
24
+ $original = $app->getLocale();
25
+
26
+ try {
27
+ $app->setLocale($locale);
28
+
29
+ return $callback();
30
+ } finally {
31
+ $app->setLocale($original);
32
+ }
33
+ }
34
+ }
vendor/illuminate/support/Traits/Macroable.php DELETED
@@ -1,83 +0,0 @@
1
- <?php
2
-
3
- namespace Illuminate\Support\Traits;
4
-
5
- use Closure;
6
- use BadMethodCallException;
7
-
8
- trait Macroable
9
- {
10
- /**
11
- * The registered string macros.
12
- *
13
- * @var array
14
- */
15
- protected static $macros = [];
16
-
17
- /**
18
- * Register a custom macro.
19
- *
20
- * @param string $name
21
- * @param callable $macro
22
- * @return void
23
- */
24
- public static function macro($name, callable $macro)
25
- {
26
- static::$macros[$name] = $macro;
27
- }
28
-
29
- /**
30
- * Checks if macro is registered.
31
- *
32
- * @param string $name
33
- * @return bool
34
- */
35
- public static function hasMacro($name)
36
- {
37
- return isset(static::$macros[$name]);
38
- }
39
-
40
- /**
41
- * Dynamically handle calls to the class.
42
- *
43
- * @param string $method
44
- * @param array $parameters
45
- * @return mixed
46
- *
47
- * @throws \BadMethodCallException
48
- */
49
- public static function __callStatic($method, $parameters)
50
- {
51
- if (! static::hasMacro($method)) {
52
- throw new BadMethodCallException("Method {$method} does not exist.");
53
- }
54
-
55
- if (static::$macros[$method] instanceof Closure) {
56
- return call_user_func_array(Closure::bind(static::$macros[$method], null, static::class), $parameters);
57
- }
58
-
59
- return call_user_func_array(static::$macros[$method], $parameters);
60
- }
61
-
62
- /**
63
- * Dynamically handle calls to the class.
64
- *
65
- * @param string $method
66
- * @param array $parameters
67
- * @return mixed
68
- *
69
- * @throws \BadMethodCallException
70
- */
71
- public function __call($method, $parameters)
72
- {
73
- if (! static::hasMacro($method)) {
74
- throw new BadMethodCallException("Method {$method} does not exist.");
75
- }
76
-
77
- if (static::$macros[$method] instanceof Closure) {
78
- return call_user_func_array(static::$macros[$method]->bindTo($this, static::class), $parameters);
79
- }
80
-
81
- return call_user_func_array(static::$macros[$method], $parameters);
82
- }
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/illuminate/support/Traits/ReflectsClosures.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Traits;
4
+
5
+ use Closure;
6
+ use Illuminate\Support\Reflector;
7
+ use ReflectionFunction;
8
+ use RuntimeException;
9
+
10
+ trait ReflectsClosures
11
+ {
12
+ /**
13
+ * Get the class names / types of the parameters of the given Closure.
14
+ *
15
+ * @param \Closure $closure
16
+ * @return array
17
+ *
18
+ * @throws \ReflectionException
19
+ */
20
+ protected function closureParameterTypes(Closure $closure)
21
+ {
22
+ $reflection = new ReflectionFunction($closure);
23
+
24
+ return collect($reflection->getParameters())->mapWithKeys(function ($parameter) {
25
+ if ($parameter->isVariadic()) {
26
+ return [$parameter->getName() => null];
27
+ }
28
+
29
+ return [$parameter->getName() => Reflector::getParameterClassName($parameter)];
30
+ })->all();
31
+ }
32
+
33
+ /**
34
+ * Get the class name of the first parameter of the given Closure.
35
+ *
36
+ * @param \Closure $closure
37
+ * @return string
38
+ *
39
+ * @throws \ReflectionException|\RuntimeException
40
+ */
41
+ protected function firstClosureParameterType(Closure $closure)
42
+ {
43
+ $types = array_values($this->closureParameterTypes($closure));
44
+
45
+ if (! $types) {
46
+ throw new RuntimeException('The given Closure has no parameters.');
47
+ }
48
+
49
+ if ($types[0] === null) {
50
+ throw new RuntimeException('The first parameter of the given Closure is missing a type hint.');
51
+ }
52
+
53
+ return $types[0];
54
+ }
55
+ }
vendor/illuminate/support/Traits/Tappable.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Illuminate\Support\Traits;
4
+
5
+ trait Tappable
6
+ {
7
+ /**
8
+ * Call the given Closure with this instance then return the instance.
9
+ *
10
+ * @param callable|null $callback
11
+ * @return mixed
12
+ */
13
+ public function tap($callback = null)
14
+ {
15
+ return tap($this, $callback);
16
+ }
17
+ }
vendor/illuminate/support/ViewErrorBag.php CHANGED
@@ -117,4 +117,14 @@ class ViewErrorBag implements Countable
117
  {
118
  $this->put($key, $value);
119
  }
 
 
 
 
 
 
 
 
 
 
120
  }
117
  {
118
  $this->put($key, $value);
119
  }
120
+
121
+ /**
122
+ * Convert the default bag to its string representation.
123
+ *
124
+ * @return string
125
+ */
126
+ public function __toString()
127
+ {
128
+ return (string) $this->getBag('default');
129
+ }
130
  }
vendor/illuminate/support/composer.json CHANGED
@@ -14,14 +14,18 @@
14
  }
15
  ],
16
  "require": {
17
- "php": ">=5.6.4",
 
18
  "ext-mbstring": "*",
19
- "doctrine/inflector": "~1.1",
20
- "illuminate/contracts": "5.4.*",
21
- "paragonie/random_compat": "~1.4|~2.0"
 
 
 
22
  },
23
- "replace": {
24
- "tightenco/collect": "self.version"
25
  },
26
  "autoload": {
27
  "psr-4": {
@@ -33,13 +37,16 @@
33
  },
34
  "extra": {
35
  "branch-alias": {
36
- "dev-master": "5.4-dev"
37
  }
38
  },
39
  "suggest": {
40
- "illuminate/filesystem": "Required to use the composer class (5.2.*).",
41
- "symfony/process": "Required to use the composer class (~3.2).",
42
- "symfony/var-dumper": "Required to use the dd function (~3.2)."
 
 
 
43
  },
44
  "config": {
45
  "sort-packages": true
14
  }
15
  ],
16
  "require": {
17
+ "php": "^7.3|^8.0",
18
+ "ext-json": "*",
19
  "ext-mbstring": "*",
20
+ "doctrine/inflector": "^1.4|^2.0",
21
+ "illuminate/collections": "^8.0",
22
+ "illuminate/contracts": "^8.0",
23
+ "illuminate/macroable": "^8.0",
24
+ "nesbot/carbon": "^2.31",
25
+ "voku/portable-ascii": "^1.4.8"
26
  },
27
+ "conflict": {
28
+ "tightenco/collect": "<5.5.33"
29
  },
30
  "autoload": {
31
  "psr-4": {
37
  },
38
  "extra": {
39
  "branch-alias": {
40
+ "dev-master": "8.x-dev"
41
  }
42
  },
43
  "suggest": {
44
+ "illuminate/filesystem": "Required to use the composer class (^8.0).",
45
+ "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3).",
46
+ "ramsey/uuid": "Required to use Str::uuid() (^4.0).",
47
+ "symfony/process": "Required to use the composer class (^5.1.4).",
48
+ "symfony/var-dumper": "Required to use the dd function (^5.1.4).",
49
+ "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)."
50
  },
51
  "config": {
52
  "sort-packages": true
vendor/illuminate/support/helpers.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
- use Illuminate\Support\Arr;
4
- use Illuminate\Support\Str;
5
- use Illuminate\Support\Collection;
6
- use Illuminate\Support\Debug\Dumper;
7
  use Illuminate\Contracts\Support\Htmlable;
 
 
8
  use Illuminate\Support\HigherOrderTapProxy;
 
9
 
10
  if (! function_exists('append_config')) {
11
  /**
@@ -30,316 +30,32 @@ if (! function_exists('append_config')) {
30
  }
31
  }
32
 
33
- if (! function_exists('array_add')) {
34
- /**
35
- * Add an element to an array using "dot" notation if it doesn't exist.
36
- *
37
- * @param array $array
38
- * @param string $key
39
- * @param mixed $value
40
- * @return array
41
- */
42
- function array_add($array, $key, $value)
43
- {
44
- return Arr::add($array, $key, $value);
45
- }
46
- }
47
-
48
- if (! function_exists('array_collapse')) {
49
- /**
50
- * Collapse an array of arrays into a single array.
51
- *
52
- * @param array $array
53
- * @return array
54
- */
55
- function array_collapse($array)
56
- {
57
- return Arr::collapse($array);
58
- }
59
- }
60
-
61
- if (! function_exists('array_divide')) {
62
- /**
63
- * Divide an array into two arrays. One with keys and the other with values.
64
- *
65
- * @param array $array
66
- * @return array
67
- */
68
- function array_divide($array)
69
- {
70
- return Arr::divide($array);
71
- }
72
- }
73
-
74
- if (! function_exists('array_dot')) {
75
- /**
76
- * Flatten a multi-dimensional associative array with dots.
77
- *
78
- * @param array $array
79
- * @param string $prepend
80
- * @return array
81
- */
82
- function array_dot($array, $prepend = '')
83
- {
84
- return Arr::dot($array, $prepend);
85
- }
86
- }
87
-
88
- if (! function_exists('array_except')) {
89
- /**
90
- * Get all of the given array except for a specified array of items.
91
- *
92
- * @param array $array
93
- * @param array|string $keys
94
- * @return array
95
- */
96
- function array_except($array, $keys)
97
- {
98
- return Arr::except($array, $keys);
99
- }
100
- }
101
-
102
- if (! function_exists('array_first')) {
103
- /**
104
- * Return the first element in an array passing a given truth test.
105
- *
106
- * @param array $array
107
- * @param callable|null $callback
108
- * @param mixed $default
109
- * @return mixed
110
- */
111
- function array_first($array, callable $callback = null, $default = null)
112
- {
113
- return Arr::first($array, $callback, $default);
114
- }
115
- }
116
-
117
- if (! function_exists('array_flatten')) {
118
- /**
119
- * Flatten a multi-dimensional array into a single level.
120
- *
121
- * @param array $array
122
- * @param int $depth
123
- * @return array
124
- */
125
- function array_flatten($array, $depth = INF)
126
- {
127
- return Arr::flatten($array, $depth);
128
- }
129
- }
130
-
131
- if (! function_exists('array_forget')) {
132
- /**
133
- * Remove one or many array items from a given array using "dot" notation.
134
- *
135
- * @param array $array
136
- * @param array|string $keys
137
- * @return void
138
- */
139
- function array_forget(&$array, $keys)
140
- {
141
- return Arr::forget($array, $keys);
142
- }
143
- }
144
-
145
- if (! function_exists('array_get')) {
146
- /**
147
- * Get an item from an array using "dot" notation.
148
- *
149
- * @param \ArrayAccess|array $array
150
- * @param string $key
151
- * @param mixed $default
152
- * @return mixed
153
- */
154
- function array_get($array, $key, $default = null)
155
- {
156
- return Arr::get($array, $key, $default);
157
- }
158
- }
159
-
160
- if (! function_exists('array_has')) {
161
- /**
162
- * Check if an item or items exist in an array using "dot" notation.
163
- *
164
- * @param \ArrayAccess|array $array
165
- * @param string|array $keys
166
- * @return bool
167
- */
168
- function array_has($array, $keys)
169
- {
170
- return Arr::has($array, $keys);
171
- }
172
- }
173
-
174
- if (! function_exists('array_last')) {
175
- /**
176
- * Return the last element in an array passing a given truth test.
177
- *
178
- * @param array $array
179
- * @param callable|null $callback
180
- * @param mixed $default
181
- * @return mixed
182
- */
183
- function array_last($array, callable $callback = null, $default = null)
184
- {
185
- return Arr::last($array, $callback, $default);
186
- }
187
- }
188
-
189
- if (! function_exists('array_only')) {
190
- /**
191
- * Get a subset of the items from the given array.
192
- *
193
- * @param array $array
194
- * @param array|string $keys
195
- * @return array
196
- */
197
- function array_only($array, $keys)
198
- {
199
- return Arr::only($array, $keys);
200
- }
201
- }
202
-
203
- if (! function_exists('array_pluck')) {
204
  /**
205
- * Pluck an array of values from an array.
206
  *
207
- * @param array $array
208
- * @param string|array $value
209
- * @param string|array|null $key
210
- * @return array
211
- */
212
- function array_pluck($array, $value, $key = null)
213
- {
214
- return Arr::pluck($array, $value, $key);
215
- }
216
- }
217
-
218
- if (! function_exists('array_prepend')) {
219
- /**
220
- * Push an item onto the beginning of an array.
221
- *
222
- * @param array $array
223
  * @param mixed $value
224
- * @param mixed $key
225
- * @return array
226
- */
227
- function array_prepend($array, $value, $key = null)
228
- {
229
- return Arr::prepend($array, $value, $key);
230
- }
231
- }
232
-
233
- if (! function_exists('array_pull')) {
234
- /**
235
- * Get a value from the array, and remove it.
236
- *
237
- * @param array $array
238
- * @param string $key
239
- * @param mixed $default
240
- * @return mixed
241
- */
242
- function array_pull(&$array, $key, $default = null)
243
- {
244
- return Arr::pull($array, $key, $default);
245
- }
246
- }
247
-
248
- if (! function_exists('array_random')) {
249
- /**
250
- * Get a random value from an array.
251
- *
252
- * @param array $array
253
- * @param int|null $num
254
- * @return mixed
255
- */
256
- function array_random($array, $num = null)
257
- {
258
- return Arr::random($array, $num);
259
- }
260
- }
261
-
262
- if (! function_exists('array_set')) {
263
- /**
264
- * Set an array item to a given value using "dot" notation.
265
- *
266
- * If no key is given to the method, the entire array will be replaced.
267
- *
268
- * @param array $array
269
- * @param string $key
270
- * @param mixed $value
271
- * @return array
272
- */
273
- function array_set(&$array, $key, $value)
274
- {
275
- return Arr::set($array, $key, $value);
276
- }
277
- }
278
-
279
- if (! function_exists('array_sort')) {
280
- /**
281
- * Sort the array by the given callback or attribute name.
282
- *
283
- * @param array $array
284
- * @param callable|string $callback
285
- * @return array
286
  */
287
- function array_sort($array, $callback)
288
  {
289
- return Arr::sort($array, $callback);
290
- }
291
- }
292
 
293
- if (! function_exists('array_sort_recursive')) {
294
- /**
295
- * Recursively sort an array by keys and values.
296
- *
297
- * @param array $array
298
- * @return array
299
- */
300
- function array_sort_recursive($array)
301
- {
302
- return Arr::sortRecursive($array);
303
- }
304
- }
305
 
306
- if (! function_exists('array_where')) {
307
- /**
308
- * Filter the array using the given callback.
309
- *
310
- * @param array $array
311
- * @param callable $callback
312
- * @return array
313
- */
314
- function array_where($array, callable $callback)
315
- {
316
- return Arr::where($array, $callback);
317
- }
318
- }
319
 
320
- if (! function_exists('array_wrap')) {
321
- /**
322
- * If the given value is not an array, wrap it in one.
323
- *
324
- * @param mixed $value
325
- * @return array
326
- */
327
- function array_wrap($value)
328
- {
329
- return Arr::wrap($value);
330
- }
331
- }
332
 
333
- if (! function_exists('camel_case')) {
334
- /**
335
- * Convert a value to camel case.
336
- *
337
- * @param string $value
338
- * @return string
339
- */
340
- function camel_case($value)
341
- {
342
- return Str::camel($value);
343
  }
344
  }
345
 
@@ -360,7 +76,7 @@ if (! function_exists('class_basename')) {
360
 
361
  if (! function_exists('class_uses_recursive')) {
362
  /**
363
- * Returns all traits used by a class, its subclasses and trait of their traits.
364
  *
365
  * @param object|string $class
366
  * @return array
@@ -373,7 +89,7 @@ if (! function_exists('class_uses_recursive')) {
373
 
374
  $results = [];
375
 
376
- foreach (array_merge([$class => $class], class_parents($class)) as $class) {
377
  $results += trait_uses_recursive($class);
378
  }
379
 
@@ -381,184 +97,25 @@ if (! function_exists('class_uses_recursive')) {
381
  }
382
  }
383
 
384
- if (! function_exists('collect')) {
385
- /**
386
- * Create a collection from the given value.
387
- *
388
- * @param mixed $value
389
- * @return \Illuminate\Support\Collection
390
- */
391
- function collect($value = null)
392
- {
393
- return new Collection($value);
394
- }
395
- }
396
-
397
- if (! function_exists('data_fill')) {
398
- /**
399
- * Fill in data where it's missing.
400
- *
401
- * @param mixed $target
402
- * @param string|array $key
403
- * @param mixed $value
404
- * @return mixed
405
- */
406
- function data_fill(&$target, $key, $value)
407
- {
408
- return data_set($target, $key, $value, false);
409
- }
410
- }
411
-
412
- if (! function_exists('data_get')) {
413
- /**
414
- * Get an item from an array or object using "dot" notation.
415
- *
416
- * @param mixed $target
417
- * @param string|array $key
418
- * @param mixed $default
419
- * @return mixed
420
- */
421
- function data_get($target, $key, $default = null)
422
- {
423
- if (is_null($key)) {
424
- return $target;
425
- }
426
-
427
- $key = is_array($key) ? $key : explode('.', $key);
428
-
429
- while (! is_null($segment = array_shift($key))) {
430
- if ($segment === '*') {
431
- if ($target instanceof Collection) {
432
- $target = $target->all();
433
- } elseif (! is_array($target)) {
434
- return value($default);
435
- }
436
-
437
- $result = Arr::pluck($target, $key);
438
-
439
- return in_array('*', $key) ? Arr::collapse($result) : $result;
440
- }
441
-
442
- if (Arr::accessible($target) && Arr::exists($target, $segment)) {
443
- $target = $target[$segment];
444
- } elseif (is_object($target) && isset($target->{$segment})) {
445
- $target = $target->{$segment};
446
- } else {
447
- return value($default);
448
- }
449
- }
450
-
451
- return $target;
452
- }
453
- }
454
-
455
- if (! function_exists('data_set')) {
456
- /**
457
- * Set an item on an array or object using dot notation.
458
- *
459
- * @param mixed $target
460
- * @param string|array $key
461
- * @param mixed $value
462
- * @param bool $overwrite
463
- * @return mixed
464
- */
465
- function data_set(&$target, $key, $value, $overwrite = true)
466
- {
467
- $segments = is_array($key) ? $key : explode('.', $key);
468
-
469
- if (($segment = array_shift($segments)) === '*') {
470
- if (! Arr::accessible($target)) {
471
- $target = [];
472
- }
473
-
474
- if ($segments) {
475
- foreach ($target as &$inner) {
476
- data_set($inner, $segments, $value, $overwrite);
477
- }
478
- } elseif ($overwrite) {
479
- foreach ($target as &$inner) {
480
- $inner = $value;
481
- }
482
- }
483
- } elseif (Arr::accessible($target)) {
484
- if ($segments) {
485
- if (! Arr::exists($target, $segment)) {
486
- $target[$segment] = [];
487
- }
488
-
489
- data_set($target[$segment], $segments, $value, $overwrite);
490
- } elseif ($overwrite || ! Arr::exists($target, $segment)) {
491
- $target[$segment] = $value;
492
- }
493
- } elseif (is_object($target)) {
494
- if ($segments) {
495
- if (! isset($target->{$segment})) {
496
- $target->{$segment} = [];
497
- }
498
-
499
- data_set($target->{$segment}, $segments, $value, $overwrite);
500
- } elseif ($overwrite || ! isset($target->{$segment})) {
501
- $target->{$segment} = $value;
502
- }
503
- } else {
504
- $target = [];
505
-
506
- if ($segments) {
507
- data_set($target[$segment], $segments, $value, $overwrite);
508
- } elseif ($overwrite) {
509
- $target[$segment] = $value;
510
- }
511
- }
512
-
513
- return $target;
514
- }
515
- }
516
-
517
- if (! function_exists('dd')) {
518
- /**
519
- * Dump the passed variables and end the script.
520
- *
521
- * @param mixed
522
- * @return void
523
- */
524
- function dd(...$args)
525
- {
526
- foreach ($args as $x) {
527
- (new Dumper)->dump($x);
528
- }
529
-
530
- die(1);
531
- }
532
- }
533
-
534
  if (! function_exists('e')) {
535
  /**
536
- * Escape HTML special characters in a string.
537
  *
538
- * @param \Illuminate\Contracts\Support\Htmlable|string $value
 
539
  * @return string
540
  */
541
- function e($value)
542
  {
 
 
 
 
543
  if ($value instanceof Htmlable) {
544
  return $value->toHtml();
545
  }
546
 
547
- return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);
548
- }
549
- }
550
-
551
- if (! function_exists('ends_with')) {
552
- /**
553
- * Determine if a given string ends with a given substring.
554
- *
555
- * @param string $haystack
556
- * @param string|array $needles
557
- * @return bool
558
- */
559
- function ends_with($haystack, $needles)
560
- {
561
- return Str::endsWith($haystack, $needles);
562
  }
563
  }
564
 
@@ -567,76 +124,25 @@ if (! function_exists('env')) {
567
  * Gets the value of an environment variable.
568
  *
569
  * @param string $key
570
- * @param mixed $default
571
  * @return mixed
572
  */
573
  function env($key, $default = null)
574
  {
575
- $value = getenv($key);
576
-
577
- if ($value === false) {
578
- return value($default);
579
- }
580
-
581
- switch (strtolower($value)) {
582
- case 'true':
583
- case '(true)':
584
- return true;
585
- case 'false':
586
- case '(false)':
587
- return false;
588
- case 'empty':
589
- case '(empty)':
590
- return '';
591
- case 'null':
592
- case '(null)':
593
- return;
594
- }
595
-
596
- if (strlen($value) > 1 && Str::startsWith($value, '"') && Str::endsWith($value, '"')) {
597
- return substr($value, 1, -1);
598
- }
599
-
600
- return $value;
601
- }
602
- }
603
-
604
- if (! function_exists('head')) {
605
- /**
606
- * Get the first element of an array. Useful for method chaining.
607
- *
608
- * @param array $array
609
- * @return mixed
610
- */
611
- function head($array)
612
- {
613
- return reset($array);
614
  }
615
  }
616
 
617
- if (! function_exists('kebab_case')) {
618
  /**
619
- * Convert a string to kebab case.
620
  *
621
- * @param string $value
622
- * @return string
623
- */
624
- function kebab_case($value)
625
- {
626
- return Str::kebab($value);
627
- }
628
- }
629
-
630
- if (! function_exists('last')) {
631
- /**
632
- * Get the last element from an array.
633
- *
634
- * @param array $array
635
- * @return mixed
636
  */
637
- function last($array)
638
  {
639
- return end($array);
640
  }
641
  }
642
 
@@ -645,13 +151,13 @@ if (! function_exists('object_get')) {
645
  * Get an item from an object using "dot" notation.
646
  *
647
  * @param object $object
648
- * @param string $key
649
- * @param mixed $default
650
  * @return mixed
651
  */
652
  function object_get($object, $key, $default = null)
653
  {
654
- if (is_null($key) || trim($key) == '') {
655
  return $object;
656
  }
657
 
@@ -667,12 +173,30 @@ if (! function_exists('object_get')) {
667
  }
668
  }
669
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
670
  if (! function_exists('preg_replace_array')) {
671
  /**
672
  * Replace a given pattern with each value in the array in sequentially.
673
  *
674
  * @param string $pattern
675
- * @param array $replacements
676
  * @param string $subject
677
  * @return string
678
  */
@@ -692,27 +216,29 @@ if (! function_exists('retry')) {
692
  *
693
  * @param int $times
694
  * @param callable $callback
695
- * @param int $sleep
 
696
  * @return mixed
697
  *
698
  * @throws \Exception
699
  */
700
- function retry($times, callable $callback, $sleep = 0)
701
  {
702
- $times--;
703
 
704
  beginning:
 
 
 
705
  try {
706
- return $callback();
707
  } catch (Exception $e) {
708
- if (! $times) {
709
  throw $e;
710
  }
711
 
712
- $times--;
713
-
714
- if ($sleep) {
715
- usleep($sleep * 1000);
716
  }
717
 
718
  goto beginning;
@@ -720,263 +246,73 @@ if (! function_exists('retry')) {
720
  }
721
  }
722
 
723
- if (! function_exists('snake_case')) {
724
- /**
725
- * Convert a string to snake case.
726
- *
727
- * @param string $value
728
- * @param string $delimiter
729
- * @return string
730
- */
731
- function snake_case($value, $delimiter = '_')
732
- {
733
- return Str::snake($value, $delimiter);
734
- }
735
- }
736
-
737
- if (! function_exists('starts_with')) {
738
- /**
739
- * Determine if a given string starts with a given substring.
740
- *
741
- * @param string $haystack
742
- * @param string|array $needles
743
- * @return bool
744
- */
745
- function starts_with($haystack, $needles)
746
- {
747
- return Str::startsWith($haystack, $needles);
748
- }
749
- }
750
-
751
- if (! function_exists('str_after')) {
752
- /**
753
- * Return the remainder of a string after a given value.
754
- *
755
- * @param string $subject
756
- * @param string $search
757
- * @return string
758
- */
759
- function str_after($subject, $search)
760
- {
761
- return Str::after($subject, $search);
762
- }
763
- }
764
-
765
- if (! function_exists('str_contains')) {
766
- /**
767
- * Determine if a given string contains a given substring.
768
- *
769
- * @param string $haystack
770
- * @param string|array $needles
771
- * @return bool
772
- */
773
- function str_contains($haystack, $needles)
774
- {
775
- return Str::contains($haystack, $needles);
776
- }
777
- }
778
-
779
- if (! function_exists('str_finish')) {
780
- /**
781
- * Cap a string with a single instance of a given value.
782
- *
783
- * @param string $value
784
- * @param string $cap
785
- * @return string
786
- */
787
- function str_finish($value, $cap)
788
- {
789
- return Str::finish($value, $cap);
790
- }
791
- }
792
-
793
- if (! function_exists('str_is')) {
794
- /**
795
- * Determine if a given string matches a given pattern.
796
- *
797
- * @param string $pattern
798
- * @param string $value
799
- * @return bool
800
- */
801
- function str_is($pattern, $value)
802
- {
803
- return Str::is($pattern, $value);
804
- }
805
- }
806
-
807
- if (! function_exists('str_limit')) {
808
- /**
809
- * Limit the number of characters in a string.
810
- *
811
- * @param string $value
812
- * @param int $limit
813
- * @param string $end
814
- * @return string
815
- */
816
- function str_limit($value, $limit = 100, $end = '...')
817
- {
818
- return Str::limit($value, $limit, $end);
819
- }
820
- }
821
-
822
- if (! function_exists('str_plural')) {
823
  /**
824
- * Get the plural form of an English word.
825
  *
826
- * @param string $value
827
- * @param int $count
828
- * @return string
829
  */
830
- function str_plural($value, $count = 2)
831
  {
832
- return Str::plural($value, $count);
833
- }
834
- }
835
 
836
- if (! function_exists('str_random')) {
837
- /**
838
- * Generate a more truly "random" alpha-numeric string.
839
- *
840
- * @param int $length
841
- * @return string
842
- *
843
- * @throws \RuntimeException
844
- */
845
- function str_random($length = 16)
846
- {
847
- return Str::random($length);
848
- }
849
- }
850
 
851
- if (! function_exists('str_replace_array')) {
852
- /**
853
- * Replace a given value in the string sequentially with an array.
854
- *
855
- * @param string $search
856
- * @param array $replace
857
- * @param string $subject
858
- * @return string
859
- */
860
- function str_replace_array($search, array $replace, $subject)
861
- {
862
- return Str::replaceArray($search, $replace, $subject);
863
  }
864
  }
865
 
866
- if (! function_exists('str_replace_first')) {
867
  /**
868
- * Replace the first occurrence of a given value in the string.
869
  *
870
- * @param string $search
871
- * @param string $replace
872
- * @param string $subject
873
- * @return string
874
- */
875
- function str_replace_first($search, $replace, $subject)
876
- {
877
- return Str::replaceFirst($search, $replace, $subject);
878
- }
879
- }
880
-
881
- if (! function_exists('str_replace_last')) {
882
- /**
883
- * Replace the last occurrence of a given value in the string.
884
  *
885
- * @param string $search
886
- * @param string $replace
887
- * @param string $subject
888
- * @return string
889
  */
890
- function str_replace_last($search, $replace, $subject)
891
  {
892
- return Str::replaceLast($search, $replace, $subject);
893
- }
894
- }
 
895
 
896
- if (! function_exists('str_singular')) {
897
- /**
898
- * Get the singular form of an English word.
899
- *
900
- * @param string $value
901
- * @return string
902
- */
903
- function str_singular($value)
904
- {
905
- return Str::singular($value);
906
- }
907
- }
908
 
909
- if (! function_exists('str_slug')) {
910
- /**
911
- * Generate a URL friendly "slug" from a given string.
912
- *
913
- * @param string $title
914
- * @param string $separator
915
- * @return string
916
- */
917
- function str_slug($title, $separator = '-')
918
- {
919
- return Str::slug($title, $separator);
920
  }
921
  }
922
 
923
- if (! function_exists('str_start')) {
924
  /**
925
- * Begin a string with a single instance of a given value.
926
  *
927
- * @param string $value
928
- * @param string $prefix
929
- * @return string
930
- */
931
- function str_start($value, $prefix)
932
- {
933
- return Str::start($value, $prefix);
934
- }
935
- }
936
-
937
- if (! function_exists('studly_case')) {
938
- /**
939
- * Convert a value to studly caps case.
940
  *
941
- * @param string $value
942
- * @return string
943
  */
944
- function studly_case($value)
945
  {
946
- return Str::studly($value);
947
- }
948
- }
 
949
 
950
- if (! function_exists('tap')) {
951
- /**
952
- * Call the given Closure with the given value then return the value.
953
- *
954
- * @param mixed $value
955
- * @param callable|null $callback
956
- * @return mixed
957
- */
958
- function tap($value, $callback = null)
959
- {
960
- if (is_null($callback)) {
961
- return new HigherOrderTapProxy($value);
962
  }
963
 
964
- $callback($value);
965
-
966
- return $value;
967
- }
968
- }
969
-
970
- if (! function_exists('title_case')) {
971
- /**
972
- * Convert a value to title case.
973
- *
974
- * @param string $value
975
- * @return string
976
- */
977
- function title_case($value)
978
- {
979
- return Str::title($value);
980
  }
981
  }
982
 
@@ -989,7 +325,7 @@ if (! function_exists('trait_uses_recursive')) {
989
  */
990
  function trait_uses_recursive($trait)
991
  {
992
- $traits = class_uses($trait);
993
 
994
  foreach ($traits as $trait) {
995
  $traits += trait_uses_recursive($trait);
@@ -999,16 +335,26 @@ if (! function_exists('trait_uses_recursive')) {
999
  }
1000
  }
1001
 
1002
- if (! function_exists('value')) {
1003
  /**
1004
- * Return the default value of the given value.
1005
  *
1006
  * @param mixed $value
1007
- * @return mixed
 
 
1008
  */
1009
- function value($value)
1010
  {
1011
- return $value instanceof Closure ? $value() : $value;
 
 
 
 
 
 
 
 
1012
  }
1013
  }
1014
 
@@ -1020,19 +366,20 @@ if (! function_exists('windows_os')) {
1020
  */
1021
  function windows_os()
1022
  {
1023
- return strtolower(substr(PHP_OS, 0, 3)) === 'win';
1024
  }
1025
  }
1026
 
1027
  if (! function_exists('with')) {
1028
  /**
1029
- * Return the given object. Useful for chaining.
1030
  *
1031
- * @param mixed $object
 
1032
  * @return mixed
1033
  */
1034
- function with($object)
1035
  {
1036
- return $object;
1037
  }
1038
  }
1
  <?php
2
 
3
+ use Illuminate\Contracts\Support\DeferringDisplayableValue;
 
 
 
4
  use Illuminate\Contracts\Support\Htmlable;
5
+ use Illuminate\Support\Arr;
6
+ use Illuminate\Support\Env;
7
  use Illuminate\Support\HigherOrderTapProxy;
8
+ use Illuminate\Support\Optional;
9
 
10
  if (! function_exists('append_config')) {
11
  /**
30
  }
31
  }
32
 
33
+ if (! function_exists('blank')) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
+ * Determine if the given value is "blank".
36
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  * @param mixed $value
38
+ * @return bool
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  */
40
+ function blank($value)
41
  {
42
+ if (is_null($value)) {
43
+ return true;
44
+ }
45
 
46
+ if (is_string($value)) {
47
+ return trim($value) === '';
48
+ }
 
 
 
 
 
 
 
 
 
49
 
50
+ if (is_numeric($value) || is_bool($value)) {
51
+ return false;
52
+ }
 
 
 
 
 
 
 
 
 
 
53
 
54
+ if ($value instanceof Countable) {
55
+ return count($value) === 0;
56
+ }
 
 
 
 
 
 
 
 
 
57
 
58
+ return empty($value);
 
 
 
 
 
 
 
 
 
59
  }
60
  }
61
 
76
 
77
  if (! function_exists('class_uses_recursive')) {
78
  /**
79
+ * Returns all traits used by a class, its parent classes and trait of their traits.
80
  *
81
  * @param object|string $class
82
  * @return array
89
 
90
  $results = [];
91
 
92
+ foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {
93
  $results += trait_uses_recursive($class);
94
  }
95
 
97
  }
98
  }
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  if (! function_exists('e')) {
101
  /**
102
+ * Encode HTML special characters in a string.
103
  *
104
+ * @param \Illuminate\Contracts\Support\DeferringDisplayableValue|\Illuminate\Contracts\Support\Htmlable|string|null $value
105
+ * @param bool $doubleEncode
106
  * @return string
107
  */
108
+ function e($value, $doubleEncode = true)
109
  {
110
+ if ($value instanceof DeferringDisplayableValue) {
111
+ $value = $value->resolveDisplayableValue();
112
+ }
113
+
114
  if ($value instanceof Htmlable) {
115
  return $value->toHtml();
116
  }
117
 
118
+ return htmlspecialchars($value ?? '', ENT_QUOTES, 'UTF-8', $doubleEncode);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  }
120
  }
121
 
124
  * Gets the value of an environment variable.
125
  *
126
  * @param string $key
127
+ * @param mixed $default
128
  * @return mixed
129
  */
130
  function env($key, $default = null)
131
  {
132
+ return Env::get($key, $default);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
  }
135
 
136
+ if (! function_exists('filled')) {
137
  /**
138
+ * Determine if a value is "filled".
139
  *
140
+ * @param mixed $value
141
+ * @return bool
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  */
143
+ function filled($value)
144
  {
145
+ return ! blank($value);
146
  }
147
  }
148
 
151
  * Get an item from an object using "dot" notation.
152
  *
153
  * @param object $object
154
+ * @param string|null $key
155
+ * @param mixed $default
156
  * @return mixed
157
  */
158
  function object_get($object, $key, $default = null)
159
  {
160
+ if (is_null($key) || trim($key) === '') {
161
  return $object;
162
  }
163
 
173
  }
174
  }
175
 
176
+ if (! function_exists('optional')) {
177
+ /**
178
+ * Provide access to optional objects.
179
+ *
180
+ * @param mixed $value
181
+ * @param callable|null $callback
182
+ * @return mixed
183
+ */
184
+ function optional($value = null, callable $callback = null)
185
+ {
186
+ if (is_null($callback)) {
187
+ return new Optional($value);
188
+ } elseif (! is_null($value)) {
189
+ return $callback($value);
190
+ }
191
+ }
192
+ }
193
+
194
  if (! function_exists('preg_replace_array')) {
195
  /**
196
  * Replace a given pattern with each value in the array in sequentially.
197
  *
198
  * @param string $pattern
199
+ * @param array $replacements
200
  * @param string $subject
201
  * @return string
202
  */
216
  *
217
  * @param int $times
218
  * @param callable $callback
219
+ * @param int $sleepMilliseconds
220
+ * @param callable|null $when
221
  * @return mixed
222
  *
223
  * @throws \Exception
224
  */
225
+ function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null)
226
  {
227
+ $attempts = 0;
228
 
229
  beginning:
230
+ $attempts++;
231
+ $times--;
232
+
233
  try {
234
+ return $callback($attempts);
235
  } catch (Exception $e) {
236
+ if ($times < 1 || ($when && ! $when($e))) {
237
  throw $e;
238
  }
239
 
240
+ if ($sleepMilliseconds) {
241
+ usleep($sleepMilliseconds * 1000);
 
 
242
  }
243
 
244
  goto beginning;
246
  }
247
  }
248
 
249
+ if (! function_exists('tap')) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  /**
251
+ * Call the given Closure with the given value then return the value.
252
  *
253
+ * @param mixed $value
254
+ * @param callable|null $callback
255
+ * @return mixed
256
  */
257
+ function tap($value, $callback = null)
258
  {
259
+ if (is_null($callback)) {
260
+ return new HigherOrderTapProxy($value);
261
+ }
262
 
263
+ $callback($value);
 
 
 
 
 
 
 
 
 
 
 
 
 
264
 
265
+ return $value;
 
 
 
 
 
 
 
 
 
 
 
266
  }
267
  }
268
 
269
+ if (! function_exists('throw_if')) {
270
  /**
271
+ * Throw the given exception if the given condition is true.
272
  *
273
+ * @param mixed $condition
274
+ * @param \Throwable|string $exception
275
+ * @param array ...$parameters
276
+ * @return mixed
 
 
 
 
 
 
 
 
 
 
277
  *
278
+ * @throws \Throwable
 
 
 
279
  */
280
+ function throw_if($condition, $exception = 'RuntimeException', ...$parameters)
281
  {
282
+ if ($condition) {
283
+ if (is_string($exception) && class_exists($exception)) {
284
+ $exception = new $exception(...$parameters);
285
+ }
286
 
287
+ throw is_string($exception) ? new RuntimeException($exception) : $exception;
288
+ }
 
 
 
 
 
 
 
 
 
 
289
 
290
+ return $condition;
 
 
 
 
 
 
 
 
 
 
291
  }
292
  }
293
 
294
+ if (! function_exists('throw_unless')) {
295
  /**
296
+ * Throw the given exception unless the given condition is true.
297
  *
298
+ * @param mixed $condition
299
+ * @param \Throwable|string $exception
300
+ * @param array ...$parameters
301
+ * @return mixed
 
 
 
 
 
 
 
 
 
302
  *
303
+ * @throws \Throwable
 
304
  */
305
+ function throw_unless($condition, $exception = 'RuntimeException', ...$parameters)
306
  {
307
+ if (! $condition) {
308
+ if (is_string($exception) && class_exists($exception)) {
309
+ $exception = new $exception(...$parameters);
310
+ }
311
 
312
+ throw is_string($exception) ? new RuntimeException($exception) : $exception;
 
 
 
 
 
 
 
 
 
 
 
313
  }
314
 
315
+ return $condition;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  }
317
  }
318
 
325
  */
326
  function trait_uses_recursive($trait)
327
  {
328
+ $traits = class_uses($trait) ?: [];
329
 
330
  foreach ($traits as $trait) {
331
  $traits += trait_uses_recursive($trait);
335
  }
336
  }
337
 
338
+ if (! function_exists('transform')) {
339
  /**
340
+ * Transform the given value if it is present.
341
  *
342
  * @param mixed $value
343
+ * @param callable $callback
344
+ * @param mixed $default
345
+ * @return mixed|null
346
  */
347
+ function transform($value, callable $callback, $default = null)
348
  {
349
+ if (filled($value)) {
350
+ return $callback($value);
351
+ }
352
+
353
+ if (is_callable($default)) {
354
+ return $default($value);
355
+ }
356
+
357
+ return $default;
358
  }
359
  }
360
 
366
  */
367
  function windows_os()
368
  {
369
+ return PHP_OS_FAMILY === 'Windows';
370
  }
371
  }
372
 
373
  if (! function_exists('with')) {
374
  /**
375
+ * Return the given value, optionally passed through the given callback.
376
  *
377
+ * @param mixed $value
378
+ * @param callable|null $callback
379
  * @return mixed
380
  */
381
+ function with($value, callable $callback = null)
382
  {
383
+ return is_null($callback) ? $value : $callback($value);
384
  }
385
  }
vendor/paragonie/random_compat/composer.json DELETED
@@ -1,38 +0,0 @@
1
- {
2
- "name": "paragonie/random_compat",
3
- "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
4
- "keywords": [
5
- "csprng",
6
- "random",
7
- "polyfill",
8
- "pseudorandom"
9
- ],
10
- "license": "MIT",
11
- "type": "library",
12
- "authors": [
13
- {
14
- "name": "Paragon Initiative Enterprises",
15
- "email": "security@paragonie.com",
16
- "homepage": "https://paragonie.com"
17
- }
18
- ],
19
- "support": {
20
- "issues": "https://github.com/paragonie/random_compat/issues",
21
- "email": "info@paragonie.com",
22
- "source": "https://github.com/paragonie/random_compat"
23
- },
24
- "require": {
25
- "php": ">=5.2.0"
26
- },
27
- "require-dev": {
28
- "phpunit/phpunit": "4.*|5.*"
29
- },
30
- "suggest": {
31
- "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
32
- },
33
- "autoload": {
34
- "files": [
35
- "lib/random.php"
36
- ]
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/dist/random_compat.phar.pubkey DELETED
@@ -1,5 +0,0 @@
1
- -----BEGIN PUBLIC KEY-----
2
- MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEEd+wCqJDrx5B4OldM0dQE0ZMX+lx1ZWm
3
- pui0SUqD4G29L3NGsz9UhJ/0HjBdbnkhIK5xviT0X5vtjacF6ajgcCArbTB+ds+p
4
- +h7Q084NuSuIpNb6YPfoUFgC/CL9kAoc
5
- -----END PUBLIC KEY-----
 
 
 
 
 
vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc DELETED
@@ -1,11 +0,0 @@
1
- -----BEGIN PGP SIGNATURE-----
2
- Version: GnuPG v2.0.22 (MingW32)
3
-
4
- iQEcBAABAgAGBQJWtW1hAAoJEGuXocKCZATaJf0H+wbZGgskK1dcRTsuVJl9IWip
5
- QwGw/qIKI280SD6/ckoUMxKDCJiFuPR14zmqnS36k7N5UNPnpdTJTS8T11jttSpg
6
- 1LCmgpbEIpgaTah+cELDqFCav99fS+bEiAL5lWDAHBTE/XPjGVCqeehyPYref4IW
7
- NDBIEsvnHPHPLsn6X5jq4+Yj5oUixgxaMPiR+bcO4Sh+RzOVB6i2D0upWfRXBFXA
8
- NNnsg9/zjvoC7ZW73y9uSH+dPJTt/Vgfeiv52/v41XliyzbUyLalf02GNPY+9goV
9
- JHG1ulEEBJOCiUD9cE1PUIJwHA/HqyhHIvV350YoEFiHl8iSwm7SiZu5kPjaq74=
10
- =B6+8
11
- -----END PGP SIGNATURE-----
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/byte_safe_strings.php DELETED
@@ -1,195 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
9
- *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in
18
- * all copies or substantial portions of the Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
27
- */
28
-
29
- if (!is_callable('RandomCompat_strlen')) {
30
- if (
31
- defined('MB_OVERLOAD_STRING')
32
- &&
33
- ((int) ini_get('mbstring.func_overload')) & MB_OVERLOAD_STRING
34
- ) {
35
- /**
36
- * strlen() implementation that isn't brittle to mbstring.func_overload
37
- *
38
- * This version uses mb_strlen() in '8bit' mode to treat strings as raw
39
- * binary rather than UTF-8, ISO-8859-1, etc
40
- *
41
- * @param string $binary_string
42
- *
43
- * @throws TypeError
44
- *
45
- * @return int
46
- */
47
- function RandomCompat_strlen($binary_string)
48
- {
49
- if (!is_string($binary_string)) {
50
- throw new TypeError(
51
- 'RandomCompat_strlen() expects a string'
52
- );
53
- }
54
-
55
- return (int) mb_strlen($binary_string, '8bit');
56
- }
57
-
58
- } else {
59
- /**
60
- * strlen() implementation that isn't brittle to mbstring.func_overload
61
- *
62
- * This version just used the default strlen()
63
- *
64
- * @param string $binary_string
65
- *
66
- * @throws TypeError
67
- *
68
- * @return int
69
- */
70
- function RandomCompat_strlen($binary_string)
71
- {
72
- if (!is_string($binary_string)) {
73
- throw new TypeError(
74
- 'RandomCompat_strlen() expects a string'
75
- );
76
- }
77
- return (int) strlen($binary_string);
78
- }
79
- }
80
- }
81
-
82
- if (!is_callable('RandomCompat_substr')) {
83
-
84
- if (
85
- defined('MB_OVERLOAD_STRING')
86
- &&
87
- ((int) ini_get('mbstring.func_overload')) & MB_OVERLOAD_STRING
88
- ) {
89
- /**
90
- * substr() implementation that isn't brittle to mbstring.func_overload
91
- *
92
- * This version uses mb_substr() in '8bit' mode to treat strings as raw
93
- * binary rather than UTF-8, ISO-8859-1, etc
94
- *
95
- * @param string $binary_string
96
- * @param int $start
97
- * @param int|null $length (optional)
98
- *
99
- * @throws TypeError
100
- *
101
- * @return string
102
- */
103
- function RandomCompat_substr($binary_string, $start, $length = null)
104
- {
105
- if (!is_string($binary_string)) {
106
- throw new TypeError(
107
- 'RandomCompat_substr(): First argument should be a string'
108
- );
109
- }
110
-
111
- if (!is_int($start)) {
112
- throw new TypeError(
113
- 'RandomCompat_substr(): Second argument should be an integer'
114
- );
115
- }
116
-
117
- if ($length === null) {
118
- /**
119
- * mb_substr($str, 0, NULL, '8bit') returns an empty string on
120
- * PHP 5.3, so we have to find the length ourselves.
121
- */
122
- /** @var int $length */
123
- $length = RandomCompat_strlen($binary_string) - $start;
124
- } elseif (!is_int($length)) {
125
- throw new TypeError(
126
- 'RandomCompat_substr(): Third argument should be an integer, or omitted'
127
- );
128
- }
129
-
130
- // Consistency with PHP's behavior
131
- if ($start === RandomCompat_strlen($binary_string) && $length === 0) {
132
- return '';
133
- }
134
- if ($start > RandomCompat_strlen($binary_string)) {
135
- return '';
136
- }
137
-
138
- return (string) mb_substr(
139
- (string) $binary_string,
140
- (int) $start,
141
- (int) $length,
142
- '8bit'
143
- );
144
- }
145
-
146
- } else {
147
-
148
- /**
149
- * substr() implementation that isn't brittle to mbstring.func_overload
150
- *
151
- * This version just uses the default substr()
152
- *
153
- * @param string $binary_string
154
- * @param int $start
155
- * @param int|null $length (optional)
156
- *
157
- * @throws TypeError
158
- *
159
- * @return string
160
- */
161
- function RandomCompat_substr($binary_string, $start, $length = null)
162
- {
163
- if (!is_string($binary_string)) {
164
- throw new TypeError(
165
- 'RandomCompat_substr(): First argument should be a string'
166
- );
167
- }
168
-
169
- if (!is_int($start)) {
170
- throw new TypeError(
171
- 'RandomCompat_substr(): Second argument should be an integer'
172
- );
173
- }
174
-
175
- if ($length !== null) {
176
- if (!is_int($length)) {
177
- throw new TypeError(
178
- 'RandomCompat_substr(): Third argument should be an integer, or omitted'
179
- );
180
- }
181
-
182
- return (string) substr(
183
- (string )$binary_string,
184
- (int) $start,
185
- (int) $length
186
- );
187
- }
188
-
189
- return (string) substr(
190
- (string) $binary_string,
191
- (int) $start
192
- );
193
- }
194
- }
195
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/cast_to_int.php DELETED
@@ -1,77 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
9
- *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in
18
- * all copies or substantial portions of the Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
27
- */
28
-
29
- if (!is_callable('RandomCompat_intval')) {
30
-
31
- /**
32
- * Cast to an integer if we can, safely.
33
- *
34
- * If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX)
35
- * (non-inclusive), it will sanely cast it to an int. If you it's equal to
36
- * ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats
37
- * lose precision, so the <= and => operators might accidentally let a float
38
- * through.
39
- *
40
- * @param int|float $number The number we want to convert to an int
41
- * @param bool $fail_open Set to true to not throw an exception
42
- *
43
- * @return float|int
44
- * @psalm-suppress InvalidReturnType
45
- *
46
- * @throws TypeError
47
- */
48
- function RandomCompat_intval($number, $fail_open = false)
49
- {
50
- if (is_int($number) || is_float($number)) {
51
- $number += 0;
52
- } elseif (is_numeric($number)) {
53
- /** @psalm-suppress InvalidOperand */
54
- $number += 0;
55
- }
56
- /** @var int|float $number */
57
-
58
- if (
59
- is_float($number)
60
- &&
61
- $number > ~PHP_INT_MAX
62
- &&
63
- $number < PHP_INT_MAX
64
- ) {
65
- $number = (int) $number;
66
- }
67
-
68
- if (is_int($number)) {
69
- return (int) $number;
70
- } elseif (!$fail_open) {
71
- throw new TypeError(
72
- 'Expected an integer.'
73
- );
74
- }
75
- return $number;
76
- }
77
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/error_polyfill.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
9
- *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in
18
- * all copies or substantial portions of the Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
27
- */
28
-
29
- if (!class_exists('Error', false)) {
30
- // We can't really avoid making this extend Exception in PHP 5.
31
- class Error extends Exception
32
- {
33
-
34
- }
35
- }
36
-
37
- if (!class_exists('TypeError', false)) {
38
- if (is_subclass_of('Error', 'Exception')) {
39
- class TypeError extends Error
40
- {
41
-
42
- }
43
- } else {
44
- class TypeError extends Exception
45
- {
46
-
47
- }
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/random.php DELETED
@@ -1,225 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * @version 2.0.17
7
- * @released 2018-07-04
8
- *
9
- * The MIT License (MIT)
10
- *
11
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
- * copies of the Software, and to permit persons to whom the Software is
18
- * furnished to do so, subject to the following conditions:
19
- *
20
- * The above copyright notice and this permission notice shall be included in
21
- * all copies or substantial portions of the Software.
22
- *
23
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
- * SOFTWARE.
30
- */
31
-
32
- if (!defined('PHP_VERSION_ID')) {
33
- // This constant was introduced in PHP 5.2.7
34
- $RandomCompatversion = array_map('intval', explode('.', PHP_VERSION));
35
- define(
36
- 'PHP_VERSION_ID',
37
- $RandomCompatversion[0] * 10000
38
- + $RandomCompatversion[1] * 100
39
- + $RandomCompatversion[2]
40
- );
41
- $RandomCompatversion = null;
42
- }
43
-
44
- /**
45
- * PHP 7.0.0 and newer have these functions natively.
46
- */
47
- if (PHP_VERSION_ID >= 70000) {
48
- return;
49
- }
50
-
51
- if (!defined('RANDOM_COMPAT_READ_BUFFER')) {
52
- define('RANDOM_COMPAT_READ_BUFFER', 8);
53
- }
54
-
55
- $RandomCompatDIR = dirname(__FILE__);
56
-
57
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'byte_safe_strings.php';
58
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'cast_to_int.php';
59
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'error_polyfill.php';
60
-
61
- if (!is_callable('random_bytes')) {
62
- /**
63
- * PHP 5.2.0 - 5.6.x way to implement random_bytes()
64
- *
65
- * We use conditional statements here to define the function in accordance
66
- * to the operating environment. It's a micro-optimization.
67
- *
68
- * In order of preference:
69
- * 1. Use libsodium if available.
70
- * 2. fread() /dev/urandom if available (never on Windows)
71
- * 3. mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM)
72
- * 4. COM('CAPICOM.Utilities.1')->GetRandom()
73
- *
74
- * See RATIONALE.md for our reasoning behind this particular order
75
- */
76
- if (extension_loaded('libsodium')) {
77
- // See random_bytes_libsodium.php
78
- if (PHP_VERSION_ID >= 50300 && is_callable('\\Sodium\\randombytes_buf')) {
79
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'random_bytes_libsodium.php';
80
- } elseif (method_exists('Sodium', 'randombytes_buf')) {
81
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'random_bytes_libsodium_legacy.php';
82
- }
83
- }
84
-
85
- /**
86
- * Reading directly from /dev/urandom:
87
- */
88
- if (DIRECTORY_SEPARATOR === '/') {
89
- // DIRECTORY_SEPARATOR === '/' on Unix-like OSes -- this is a fast
90
- // way to exclude Windows.
91
- $RandomCompatUrandom = true;
92
- $RandomCompat_basedir = ini_get('open_basedir');
93
-
94
- if (!empty($RandomCompat_basedir)) {
95
- $RandomCompat_open_basedir = explode(
96
- PATH_SEPARATOR,
97
- strtolower($RandomCompat_basedir)
98
- );
99
- $RandomCompatUrandom = (array() !== array_intersect(
100
- array('/dev', '/dev/', '/dev/urandom'),
101
- $RandomCompat_open_basedir
102
- ));
103
- $RandomCompat_open_basedir = null;
104
- }
105
-
106
- if (
107
- !is_callable('random_bytes')
108
- &&
109
- $RandomCompatUrandom
110
- &&
111
- @is_readable('/dev/urandom')
112
- ) {
113
- // Error suppression on is_readable() in case of an open_basedir
114
- // or safe_mode failure. All we care about is whether or not we
115
- // can read it at this point. If the PHP environment is going to
116
- // panic over trying to see if the file can be read in the first
117
- // place, that is not helpful to us here.
118
-
119
- // See random_bytes_dev_urandom.php
120
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'random_bytes_dev_urandom.php';
121
- }
122
- // Unset variables after use
123
- $RandomCompat_basedir = null;
124
- } else {
125
- $RandomCompatUrandom = false;
126
- }
127
-
128
- /**
129
- * mcrypt_create_iv()
130
- *
131
- * We only want to use mcypt_create_iv() if:
132
- *
133
- * - random_bytes() hasn't already been defined
134
- * - the mcrypt extensions is loaded
135
- * - One of these two conditions is true:
136
- * - We're on Windows (DIRECTORY_SEPARATOR !== '/')
137
- * - We're not on Windows and /dev/urandom is readabale
138
- * (i.e. we're not in a chroot jail)
139
- * - Special case:
140
- * - If we're not on Windows, but the PHP version is between
141
- * 5.6.10 and 5.6.12, we don't want to use mcrypt. It will
142
- * hang indefinitely. This is bad.
143
- * - If we're on Windows, we want to use PHP >= 5.3.7 or else
144
- * we get insufficient entropy errors.
145
- */
146
- if (
147
- !is_callable('random_bytes')
148
- &&
149
- // Windows on PHP < 5.3.7 is broken, but non-Windows is not known to be.
150
- (DIRECTORY_SEPARATOR === '/' || PHP_VERSION_ID >= 50307)
151
- &&
152
- // Prevent this code from hanging indefinitely on non-Windows;
153
- // see https://bugs.php.net/bug.php?id=69833
154
- (
155
- DIRECTORY_SEPARATOR !== '/' ||
156
- (PHP_VERSION_ID <= 50609 || PHP_VERSION_ID >= 50613)
157
- )
158
- &&
159
- extension_loaded('mcrypt')
160
- ) {
161
- // See random_bytes_mcrypt.php
162
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'random_bytes_mcrypt.php';
163
- }
164
- $RandomCompatUrandom = null;
165
-
166
- /**
167
- * This is a Windows-specific fallback, for when the mcrypt extension
168
- * isn't loaded.
169
- */
170
- if (
171
- !is_callable('random_bytes')
172
- &&
173
- extension_loaded('com_dotnet')
174
- &&
175
- class_exists('COM')
176
- ) {
177
- $RandomCompat_disabled_classes = preg_split(
178
- '#\s*,\s*#',
179
- strtolower(ini_get('disable_classes'))
180
- );
181
-
182
- if (!in_array('com', $RandomCompat_disabled_classes)) {
183
- try {
184
- $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1');
185
- if (method_exists($RandomCompatCOMtest, 'GetRandom')) {
186
- // See random_bytes_com_dotnet.php
187
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'random_bytes_com_dotnet.php';
188
- }
189
- } catch (com_exception $e) {
190
- // Don't try to use it.
191
- }
192
- }
193
- $RandomCompat_disabled_classes = null;
194
- $RandomCompatCOMtest = null;
195
- }
196
-
197
- /**
198
- * throw new Exception
199
- */
200
- if (!is_callable('random_bytes')) {
201
- /**
202
- * We don't have any more options, so let's throw an exception right now
203
- * and hope the developer won't let it fail silently.
204
- *
205
- * @param mixed $length
206
- * @psalm-suppress InvalidReturnType
207
- * @throws Exception
208
- * @return string
209
- */
210
- function random_bytes($length)
211
- {
212
- unset($length); // Suppress "variable not used" warnings.
213
- throw new Exception(
214
- 'There is no suitable CSPRNG installed on your system'
215
- );
216
- return '';
217
- }
218
- }
219
- }
220
-
221
- if (!is_callable('random_int')) {
222
- require_once $RandomCompatDIR . DIRECTORY_SEPARATOR . 'random_int.php';
223
- }
224
-
225
- $RandomCompatDIR = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
9
- *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in
18
- * all copies or substantial portions of the Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
27
- */
28
-
29
- if (!is_callable('random_bytes')) {
30
- /**
31
- * Windows with PHP < 5.3.0 will not have the function
32
- * openssl_random_pseudo_bytes() available, so let's use
33
- * CAPICOM to work around this deficiency.
34
- *
35
- * @param int $bytes
36
- *
37
- * @throws Exception
38
- *
39
- * @return string
40
- */
41
- function random_bytes($bytes)
42
- {
43
- try {
44
- /** @var int $bytes */
45
- $bytes = RandomCompat_intval($bytes);
46
- } catch (TypeError $ex) {
47
- throw new TypeError(
48
- 'random_bytes(): $bytes must be an integer'
49
- );
50
- }
51
-
52
- if ($bytes < 1) {
53
- throw new Error(
54
- 'Length must be greater than 0'
55
- );
56
- }
57
-
58
- /** @var string $buf */
59
- $buf = '';
60
- if (!class_exists('COM')) {
61
- throw new Error(
62
- 'COM does not exist'
63
- );
64
- }
65
- /** @var COM $util */
66
- $util = new COM('CAPICOM.Utilities.1');
67
- $execCount = 0;
68
-
69
- /**
70
- * Let's not let it loop forever. If we run N times and fail to
71
- * get N bytes of random data, then CAPICOM has failed us.
72
- */
73
- do {
74
- $buf .= base64_decode((string) $util->GetRandom($bytes, 0));
75
- if (RandomCompat_strlen($buf) >= $bytes) {
76
- /**
77
- * Return our random entropy buffer here:
78
- */
79
- return (string) RandomCompat_substr($buf, 0, $bytes);
80
- }
81
- ++$execCount;
82
- } while ($execCount < $bytes);
83
-
84
- /**
85
- * If we reach here, PHP has failed us.
86
- */
87
- throw new Exception(
88
- 'Could not gather sufficient random data'
89
- );
90
- }
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/random_bytes_dev_urandom.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
9
- *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in
18
- * all copies or substantial portions of the Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
27
- */
28
-
29
- if (!defined('RANDOM_COMPAT_READ_BUFFER')) {
30
- define('RANDOM_COMPAT_READ_BUFFER', 8);
31
- }
32
-
33
- if (!is_callable('random_bytes')) {
34
- /**
35
- * Unless open_basedir is enabled, use /dev/urandom for
36
- * random numbers in accordance with best practices
37
- *
38
- * Why we use /dev/urandom and not /dev/random
39
- * @ref https://www.2uo.de/myths-about-urandom
40
- * @ref http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers
41
- *
42
- * @param int $bytes
43
- *
44
- * @throws Exception
45
- *
46
- * @return string
47
- */
48
- function random_bytes($bytes)
49
- {
50
- /** @var resource $fp */
51
- static $fp = null;
52
-
53
- /**
54
- * This block should only be run once
55
- */
56
- if (empty($fp)) {
57
- /**
58
- * We don't want to ever read C:\dev\random, only /dev/urandom on
59
- * Unix-like operating systems. While we guard against this
60
- * condition in random.php, it doesn't hurt to be defensive in depth
61
- * here.
62
- *
63
- * To that end, we only try to open /dev/urandom if we're on a Unix-
64
- * like operating system (which means the directory separator is set
65
- * to "/" not "\".
66
- */
67
- if (DIRECTORY_SEPARATOR === '/') {
68
- if (!is_readable('/dev/urandom')) {
69
- throw new Exception(
70
- 'Environment misconfiguration: ' .
71
- '/dev/urandom cannot be read.'
72
- );
73
- }
74
- /**
75
- * We use /dev/urandom if it is a char device.
76
- * We never fall back to /dev/random
77
- */
78
- /** @var resource|bool $fp */
79
- $fp = fopen('/dev/urandom', 'rb');
80
- if (is_resource($fp)) {
81
- /** @var array<string, int> $st */
82
- $st = fstat($fp);
83
- if (($st['mode'] & 0170000) !== 020000) {
84
- fclose($fp);
85
- $fp = false;
86
- }
87
- }
88
- }
89
-
90
- if (is_resource($fp)) {
91
- /**
92
- * stream_set_read_buffer() does not exist in HHVM
93
- *
94
- * If we don't set the stream's read buffer to 0, PHP will
95
- * internally buffer 8192 bytes, which can waste entropy
96
- *
97
- * stream_set_read_buffer returns 0 on success
98
- */
99
- if (is_callable('stream_set_read_buffer')) {
100
- stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER);
101
- }
102
- if (is_callable('stream_set_chunk_size')) {
103
- stream_set_chunk_size($fp, RANDOM_COMPAT_READ_BUFFER);
104
- }
105
- }
106
- }
107
-
108
- try {
109
- /** @var int $bytes */
110
- $bytes = RandomCompat_intval($bytes);
111
- } catch (TypeError $ex) {
112
- throw new TypeError(
113
- 'random_bytes(): $bytes must be an integer'
114
- );
115
- }
116
-
117
- if ($bytes < 1) {
118
- throw new Error(
119
- 'Length must be greater than 0'
120
- );
121
- }
122
-
123
- /**
124
- * This if() block only runs if we managed to open a file handle
125
- *
126
- * It does not belong in an else {} block, because the above
127
- * if (empty($fp)) line is logic that should only be run once per
128
- * page load.
129
- */
130
- if (is_resource($fp)) {
131
- /**
132
- * @var int
133
- */
134
- $remaining = $bytes;
135
-
136
- /**
137
- * @var string|bool
138
- */
139
- $buf = '';
140
-
141
- /**
142
- * We use fread() in a loop to protect against partial reads
143
- */
144
- do {
145
- /**
146
- * @var string|bool
147
- */
148
- $read = fread($fp, $remaining);
149
- if (!is_string($read)) {
150
- /**
151
- * We cannot safely read from the file. Exit the
152
- * do-while loop and trigger the exception condition
153
- *
154
- * @var string|bool
155
- */
156
- $buf = false;
157
- break;
158
- }
159
- /**
160
- * Decrease the number of bytes returned from remaining
161
- */
162
- $remaining -= RandomCompat_strlen($read);
163
- /**
164
- * @var string $buf
165
- */
166
- $buf .= $read;
167
- } while ($remaining > 0);
168
-
169
- /**
170
- * Is our result valid?
171
- * @var string|bool $buf
172
- */
173
- if (is_string($buf)) {
174
- if (RandomCompat_strlen($buf) === $bytes) {
175
- /**
176
- * Return our random entropy buffer here:
177
- */
178
- return $buf;
179
- }
180
- }
181
- }
182
-
183
- /**
184
- * If we reach here, PHP has failed us.
185
- */
186
- throw new Exception(
187
- 'Error reading from source device'
188
- );
189
- }
190
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/random_bytes_libsodium.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
9
- *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in
18
- * all copies or substantial portions of the Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
27
- */
28
-
29
- if (!is_callable('random_bytes')) {
30
- /**
31
- * If the libsodium PHP extension is loaded, we'll use it above any other
32
- * solution.
33
- *
34
- * libsodium-php project:
35
- * @ref https://github.com/jedisct1/libsodium-php
36
- *
37
- * @param int $bytes
38
- *
39
- * @throws Exception
40
- *
41
- * @return string
42
- */
43
- function random_bytes($bytes)
44
- {
45
- try {
46
- /** @var int $bytes */
47
- $bytes = RandomCompat_intval($bytes);
48
- } catch (TypeError $ex) {
49
- throw new TypeError(
50
- 'random_bytes(): $bytes must be an integer'
51
- );
52
- }
53
-
54
- if ($bytes < 1) {
55
- throw new Error(
56
- 'Length must be greater than 0'
57
- );
58
- }
59
-
60
- /**
61
- * \Sodium\randombytes_buf() doesn't allow more than 2147483647 bytes to be
62
- * generated in one invocation.
63
- */
64
- /** @var string|bool $buf */
65
- if ($bytes > 2147483647) {
66
- $buf = '';
67
- for ($i = 0; $i < $bytes; $i += 1073741824) {
68
- $n = ($bytes - $i) > 1073741824
69
- ? 1073741824
70
- : $bytes - $i;
71
- $buf .= \Sodium\randombytes_buf($n);
72
- }
73
- } else {
74
- /** @var string|bool $buf */
75
- $buf = \Sodium\randombytes_buf($bytes);
76
- }
77
-
78
- if (is_string($buf)) {
79
- if (RandomCompat_strlen($buf) === $bytes) {
80
- return $buf;
81
- }
82
- }
83
-
84
- /**
85
- * If we reach here, PHP has failed us.
86
- */
87
- throw new Exception(
88
- 'Could not gather sufficient random data'
89
- );
90
- }
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
9
- *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in
18
- * all copies or substantial portions of the Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
27
- */
28
-
29
- if (!is_callable('random_bytes')) {
30
- /**
31
- * If the libsodium PHP extension is loaded, we'll use it above any other
32
- * solution.
33
- *
34
- * libsodium-php project:
35
- * @ref https://github.com/jedisct1/libsodium-php
36
- *
37
- * @param int $bytes
38
- *
39
- * @throws Exception
40
- *
41
- * @return string
42
- */
43
- function random_bytes($bytes)
44
- {
45
- try {
46
- /** @var int $bytes */
47
- $bytes = RandomCompat_intval($bytes);
48
- } catch (TypeError $ex) {
49
- throw new TypeError(
50
- 'random_bytes(): $bytes must be an integer'
51
- );
52
- }
53
-
54
- if ($bytes < 1) {
55
- throw new Error(
56
- 'Length must be greater than 0'
57
- );
58
- }
59
-
60
- /**
61
- * @var string
62
- */
63
- $buf = '';
64
-
65
- /**
66
- * \Sodium\randombytes_buf() doesn't allow more than 2147483647 bytes to be
67
- * generated in one invocation.
68
- */
69
- if ($bytes > 2147483647) {
70
- for ($i = 0; $i < $bytes; $i += 1073741824) {
71
- $n = ($bytes - $i) > 1073741824
72
- ? 1073741824
73
- : $bytes - $i;
74
- $buf .= Sodium::randombytes_buf((int) $n);
75
- }
76
- } else {
77
- $buf .= Sodium::randombytes_buf((int) $bytes);
78
- }
79
-
80
- if (is_string($buf)) {
81
- if (RandomCompat_strlen($buf) === $bytes) {
82
- return $buf;
83
- }
84
- }
85
-
86
- /**
87
- * If we reach here, PHP has failed us.
88
- */
89
- throw new Exception(
90
- 'Could not gather sufficient random data'
91
- );
92
- }
93
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php DELETED
@@ -1,79 +0,0 @@
1
- <?php
2
- /**
3
- * Random_* Compatibility Library
4
- * for using the new PHP 7 random_* API in PHP 5 projects
5
- *
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
9
- *
10
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11
- * of this software and associated documentation files (the "Software"), to deal
12
- * in the Software without restriction, including without limitation the rights
13
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- * copies of the Software, and to permit persons to whom the Software is
15
- * furnished to do so, subject to the following conditions:
16
- *
17
- * The above copyright notice and this permission notice shall be included in
18
- * all copies or substantial portions of the Software.
19
- *
20
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- * SOFTWARE.
27
- */
28
-
29
- if (!is_callable('random_bytes')) {
30
- /**
31
- * Powered by ext/mcrypt (and thankfully NOT libmcrypt)
32
- *
33
- * @ref https://bugs.php.net/bug.php?id=55169
34
- * @ref https://github.com/php/php-src/blob/c568ffe5171d942161fc8dda066bce844bdef676/ext/mcrypt/mcrypt.c#L1321-L1386
35
- *
36
- * @param int $bytes
37
- *
38
- * @throws Exception
39
- *
40
- * @return string
41
- */
42
- function random_bytes($bytes)
43
- {
44
- try {
45
- /** @var int $bytes */
46
- $bytes = RandomCompat_intval($bytes);
47
- } catch (TypeError $ex) {
48
- throw new TypeError(
49
- 'random_bytes(): $bytes must be an integer'
50
- );
51
- }
52
-
53
- if ($bytes < 1) {
54
- throw new Error(
55
- 'Length must be greater than 0'
56
- );
57
- }
58
-
59
- /** @var string|bool $buf */
60
- $buf = @mcrypt_create_iv((int) $bytes, (int) MCRYPT_DEV_URANDOM);
61
- if (
62
- is_string($buf)
63
- &&
64
- RandomCompat_strlen($buf) === $bytes
65
- ) {
66
- /**
67
- * Return our random entropy buffer here:
68
- */
69
- return $buf;
70
- }
71
-
72
- /**
73
- * If we reach here, PHP has failed us.
74
- */
75
- throw new Exception(
76
- 'Could not gather sufficient random data'
77
- );
78
- }
79
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/lib/random_int.php DELETED
@@ -1,204 +0,0 @@
1
- <?php
2
-
3
- if (!is_callable('random_int')) {
4
- /**
5
- * Random_* Compatibility Library
6
- * for using the new PHP 7 random_* API in PHP 5 projects
7
- *
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in
20
- * all copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * Fetch a random integer between $min and $max inclusive
33
- *
34
- * @param int $min
35
- * @param int $max
36
- *
37
- * @throws Exception
38
- *
39
- * @return int
40
- */
41
- function random_int($min, $max)
42
- {
43
- /**
44
- * Type and input logic checks
45
- *
46
- * If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX)
47
- * (non-inclusive), it will sanely cast it to an int. If you it's equal to
48
- * ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats
49
- * lose precision, so the <= and => operators might accidentally let a float
50
- * through.
51
- */
52
-
53
- try {
54
- /** @var int $min */
55
- $min = RandomCompat_intval($min);
56
- } catch (TypeError $ex) {
57
- throw new TypeError(
58
- 'random_int(): $min must be an integer'
59
- );
60
- }
61
-
62
- try {
63
- /** @var int $max */
64
- $max = RandomCompat_intval($max);
65
- } catch (TypeError $ex) {
66
- throw new TypeError(
67
- 'random_int(): $max must be an integer'
68
- );
69
- }
70
-
71
- /**
72
- * Now that we've verified our weak typing system has given us an integer,
73
- * let's validate the logic then we can move forward with generating random
74
- * integers along a given range.
75
- */
76
- if ($min > $max) {
77
- throw new Error(
78
- 'Minimum value must be less than or equal to the maximum value'
79
- );
80
- }
81
-
82
- if ($max === $min) {
83
- return (int) $min;
84
- }
85
-
86
- /**
87
- * Initialize variables to 0
88
- *
89
- * We want to store:
90
- * $bytes => the number of random bytes we need
91
- * $mask => an integer bitmask (for use with the &) operator
92
- * so we can minimize the number of discards
93
- */
94
- $attempts = $bits = $bytes = $mask = $valueShift = 0;
95
- /** @var int $attempts */
96
- /** @var int $bits */
97
- /** @var int $bytes */
98
- /** @var int $mask */
99
- /** @var int $valueShift */
100
-
101
- /**
102
- * At this point, $range is a positive number greater than 0. It might
103
- * overflow, however, if $max - $min > PHP_INT_MAX. PHP will cast it to
104
- * a float and we will lose some precision.
105
- *
106
- * @var int|float $range
107
- */
108
- $range = $max - $min;
109
-
110
- /**
111
- * Test for integer overflow:
112
- */
113
- if (!is_int($range)) {
114
-
115
- /**
116
- * Still safely calculate wider ranges.
117
- * Provided by @CodesInChaos, @oittaa
118
- *
119
- * @ref https://gist.github.com/CodesInChaos/03f9ea0b58e8b2b8d435
120
- *
121
- * We use ~0 as a mask in this case because it generates all 1s
122
- *
123
- * @ref https://eval.in/400356 (32-bit)
124
- * @ref http://3v4l.org/XX9r5 (64-bit)
125
- */
126
- $bytes = PHP_INT_SIZE;
127
- /** @var int $mask */
128
- $mask = ~0;
129
-
130
- } else {
131
-
132
- /**
133
- * $bits is effectively ceil(log($range, 2)) without dealing with
134
- * type juggling
135
- */
136
- while ($range > 0) {
137
- if ($bits % 8 === 0) {
138
- ++$bytes;
139
- }
140
- ++$bits;
141
- $range >>= 1;
142
- /** @var int $mask */
143
- $mask = $mask << 1 | 1;
144
- }
145
- $valueShift = $min;
146
- }
147
-
148
- /** @var int $val */
149
- $val = 0;
150
- /**
151
- * Now that we have our parameters set up, let's begin generating
152
- * random integers until one falls between $min and $max
153
- */
154
- /** @psalm-suppress RedundantCondition */
155
- do {
156
- /**
157
- * The rejection probability is at most 0.5, so this corresponds
158
- * to a failure probability of 2^-128 for a working RNG
159
- */
160
- if ($attempts > 128) {
161
- throw new Exception(
162
- 'random_int: RNG is broken - too many rejections'
163
- );
164
- }
165
-
166
- /**
167
- * Let's grab the necessary number of random bytes
168
- */
169
- $randomByteString = random_bytes($bytes);
170
-
171
- /**
172
- * Let's turn $randomByteString into an integer
173
- *
174
- * This uses bitwise operators (<< and |) to build an integer
175
- * out of the values extracted from ord()
176
- *
177
- * Example: [9F] | [6D] | [32] | [0C] =>
178
- * 159 + 27904 + 3276800 + 201326592 =>
179
- * 204631455
180
- */
181
- $val &= 0;
182
- for ($i = 0; $i < $bytes; ++$i) {
183
- $val |= ord($randomByteString[$i]) << ($i * 8);
184
- }
185
- /** @var int $val */
186
-
187
- /**
188
- * Apply mask
189
- */
190
- $val &= $mask;
191
- $val += $valueShift;
192
-
193
- ++$attempts;
194
- /**
195
- * If $val overflows to a floating point number,
196
- * ... or is larger than $max,
197
- * ... or smaller than $min,
198
- * then try again.
199
- */
200
- } while (!is_int($val) || $val > $max || $val < $min);
201
-
202
- return (int) $val;
203
- }
204
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/paragonie/random_compat/phpunit-autoload.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
-
3
- require_once __DIR__ . '/psalm-autoload.php';
4
-
5
- /**
6
- * This is necessary for PHPUnit on PHP >= 5.3
7
- *
8
- * Class PHPUnit_Framework_TestCase
9
- */
10
- if (PHP_VERSION_ID >= 50300) {
11
- if (!class_exists('PHPUnit_Framework_TestCase')) {
12
- require_once __DIR__ . '/other/phpunit-shim.php';
13
- }
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/psr/container/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ composer.lock
2
+ composer.phar
3
+ /vendor/
vendor/psr/container/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013-2016 container-interop
4
+ Copyright (c) 2016 PHP Framework Interoperability Group
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ this software and associated documentation files (the "Software"), to deal in
8
+ the Software without restriction, including without limitation the rights to
9
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ the Software, and to permit persons to whom the Software is furnished to do so,
11
+ subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
vendor/psr/container/README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Container interface
2
+ ==============
3
+
4
+ This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url].
5
+
6
+ Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container.
7
+
8
+ The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
9
+
10
+ [psr-url]: https://www.php-fig.org/psr/psr-11/
11
+ [package-url]: https://packagist.org/packages/psr/container
12
+ [implementation-url]: https://packagist.org/providers/psr/container-implementation
13
+
vendor/psr/container/composer.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "psr/container",
3
+ "type": "library",
4
+ "description": "Common Container Interface (PHP FIG PSR-11)",
5
+ "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"],
6
+ "homepage": "https://github.com/php-fig/container",
7
+ "license": "MIT",
8
+ "authors": [
9
+ {
10
+ "name": "PHP-FIG",
11
+ "homepage": "https://www.php-fig.org/"
12
+ }
13
+ ],
14
+ "require": {
15
+ "php": ">=7.2.0"
16
+ },
17
+ "autoload": {
18
+ "psr-4": {
19
+ "Psr\\Container\\": "src/"
20
+ }
21
+ }
22
+ }
vendor/psr/container/src/ContainerExceptionInterface.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\Container;
4
+
5
+ /**
6
+ * Base interface representing a generic exception in a container.
7
+ */
8
+ interface ContainerExceptionInterface
9
+ {
10
+ }
vendor/psr/container/src/ContainerInterface.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ namespace Psr\Container;
6
+
7
+ /**
8
+ * Describes the interface of a container that exposes methods to read its entries.
9
+ */
10
+ interface ContainerInterface
11
+ {
12
+ /**
13
+ * Finds an entry of the container by its identifier and returns it.
14
+ *
15
+ * @param string $id Identifier of the entry to look for.
16
+ *
17
+ * @throws NotFoundExceptionInterface No entry was found for **this** identifier.
18
+ * @throws ContainerExceptionInterface Error while retrieving the entry.
19
+ *
20
+ * @return mixed Entry.
21
+ */
22
+ public function get(string $id);
23
+
24
+ /**
25
+ * Returns true if the container can return an entry for the given identifier.
26
+ * Returns false otherwise.
27
+ *
28
+ * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
29
+ * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
30
+ *
31
+ * @param string $id Identifier of the entry to look for.
32
+ *
33
+ * @return bool
34
+ */
35
+ public function has(string $id);
36
+ }
vendor/psr/container/src/NotFoundExceptionInterface.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\Container;
4
+
5
+ /**
6
+ * No entry was found in the container.
7
+ */
8
+ interface NotFoundExceptionInterface extends ContainerExceptionInterface
9
+ {
10
+ }
vendor/psr/simple-cache/.editorconfig ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ; This file is for unifying the coding style for different editors and IDEs.
2
+ ; More information at http://editorconfig.org
3
+
4
+ root = true
5
+
6
+ [*]
7
+ charset = utf-8
8
+ indent_size = 4
9
+ indent_style = space
10
+ end_of_line = lf
11
+ insert_final_newline = true
12
+ trim_trailing_whitespace = true
vendor/psr/simple-cache/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 PHP Framework Interoperability Group
4
+
5
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ > of this software and associated documentation files (the "Software"), to deal
7
+ > in the Software without restriction, including without limitation the rights
8
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ > copies of the Software, and to permit persons to whom the Software is
10
+ > furnished to do so, subject to the following conditions:
11
+ >
12
+ > The above copyright notice and this permission notice shall be included in
13
+ > all copies or substantial portions of the Software.
14
+ >
15
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ > THE SOFTWARE.
vendor/psr/simple-cache/README.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ PHP FIG Simple Cache PSR
2
+ ========================
3
+
4
+ This repository holds all interfaces related to PSR-16.
5
+
6
+ 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.
7
+
8
+ 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.
vendor/psr/simple-cache/composer.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "psr/simple-cache",
3
+ "description": "Common interfaces for simple caching",
4
+ "keywords": ["psr", "psr-16", "cache", "simple-cache", "caching"],
5
+ "license": "MIT",
6
+ "authors": [
7
+ {
8
+ "name": "PHP-FIG",
9
+ "homepage": "http://www.php-fig.org/"
10
+ }
11
+ ],
12
+ "require": {
13
+ "php": ">=5.3.0"
14
+ },
15
+ "autoload": {
16
+ "psr-4": {
17
+ "Psr\\SimpleCache\\": "src/"
18
+ }
19
+ },
20
+ "extra": {
21
+ "branch-alias": {
22
+ "dev-master": "1.0.x-dev"
23
+ }
24
+ }
25
+ }
vendor/psr/simple-cache/src/CacheException.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\SimpleCache;
4
+
5
+ /**
6
+ * Interface used for all types of exceptions thrown by the implementing library.
7
+ */
8
+ interface CacheException
9
+ {
10
+ }
vendor/psr/simple-cache/src/CacheInterface.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\SimpleCache;
4
+
5
+ interface CacheInterface
6
+ {
7
+ /**
8
+ * Fetches a value from the cache.
9
+ *
10
+ * @param string $key The unique key of this item in the cache.
11
+ * @param mixed $default Default value to return if the key does not exist.
12
+ *
13
+ * @return mixed The value of the item from the cache, or $default in case of cache miss.
14
+ *
15
+ * @throws \Psr\SimpleCache\InvalidArgumentException
16
+ * MUST be thrown if the $key string is not a legal value.
17
+ */
18
+ public function get($key, $default = null);
19
+
20
+ /**
21
+ * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
22
+ *
23
+ * @param string $key The key of the item to store.
24
+ * @param mixed $value The value of the item to store, must be serializable.
25
+ * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
26
+ * the driver supports TTL then the library may set a default value
27
+ * for it or let the driver take care of that.
28
+ *
29
+ * @return bool True on success and false on failure.
30
+ *
31
+ * @throws \Psr\SimpleCache\InvalidArgumentException
32
+ * MUST be thrown if the $key string is not a legal value.
33
+ */
34
+ public function set($key, $value, $ttl = null);
35
+
36
+ /**
37
+ * Delete an item from the cache by its unique key.
38
+ *
39
+ * @param string $key The unique cache key of the item to delete.
40
+ *
41
+ * @return bool True if the item was successfully removed. False if there was an error.
42
+ *
43
+ * @throws \Psr\SimpleCache\InvalidArgumentException
44
+ * MUST be thrown if the $key string is not a legal value.
45
+ */
46
+ public function delete($key);
47
+
48
+ /**
49
+ * Wipes clean the entire cache's keys.
50
+ *
51
+ * @return bool True on success and false on failure.
52
+ */
53
+ public function clear();
54
+
55
+ /**
56
+ * Obtains multiple cache items by their unique keys.
57
+ *
58
+ * @param iterable $keys A list of keys that can obtained in a single operation.
59
+ * @param mixed $default Default value to return for keys that do not exist.
60
+ *
61
+ * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
62
+ *
63
+ * @throws \Psr\SimpleCache\InvalidArgumentException
64
+ * MUST be thrown if $keys is neither an array nor a Traversable,
65
+ * or if any of the $keys are not a legal value.
66
+ */
67
+ public function getMultiple($keys, $default = null);
68
+
69
+ /**
70
+ * Persists a set of key => value pairs in the cache, with an optional TTL.
71
+ *
72
+ * @param iterable $values A list of key => value pairs for a multiple-set operation.
73
+ * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
74
+ * the driver supports TTL then the library may set a default value
75
+ * for it or let the driver take care of that.
76
+ *
77
+ * @return bool True on success and false on failure.
78
+ *
79
+ * @throws \Psr\SimpleCache\InvalidArgumentException
80
+ * MUST be thrown if $values is neither an array nor a Traversable,
81
+ * or if any of the $values are not a legal value.
82
+ */
83
+ public function setMultiple($values, $ttl = null);
84
+
85
+ /**
86
+ * Deletes multiple cache items in a single operation.
87
+ *
88
+ * @param iterable $keys A list of string-based keys to be deleted.
89
+ *
90
+ * @return bool True if the items were successfully removed. False if there was an error.
91
+ *
92
+ * @throws \Psr\SimpleCache\InvalidArgumentException
93
+ * MUST be thrown if $keys is neither an array nor a Traversable,
94
+ * or if any of the $keys are not a legal value.
95
+ */
96
+ public function deleteMultiple($keys);
97
+
98
+ /**
99
+ * Determines whether an item is present in the cache.
100
+ *
101
+ * NOTE: It is recommended that has() is only to be used for cache warming type purposes
102
+ * and not to be used within your live applications operations for get/set, as this method
103
+ * is subject to a race condition where your has() will return true and immediately after,
104
+ * another script can remove it making the state of your app out of date.
105
+ *
106
+ * @param string $key The cache item key.
107
+ *
108
+ * @return bool
109
+ *
110
+ * @throws \Psr\SimpleCache\InvalidArgumentException
111
+ * MUST be thrown if the $key string is not a legal value.
112
+ */
113
+ public function has($key);
114
+ }
vendor/psr/simple-cache/src/InvalidArgumentException.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Psr\SimpleCache;
4
+
5
+ /**
6
+ * Exception interface for invalid cache arguments.
7
+ *
8
+ * When an invalid argument is passed it must throw an exception which implements
9
+ * this interface
10
+ */
11
+ interface InvalidArgumentException extends CacheException
12
+ {
13
+ }
vendor/symfony/finder/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- vendor/
2
- composer.lock
3
- phpunit.xml
 
 
 
vendor/symfony/finder/CHANGELOG.md CHANGED
@@ -1,6 +1,30 @@
1
  CHANGELOG
2
  =========
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  3.4.0
5
  -----
6
 
1
  CHANGELOG
2
  =========
3
 
4
+ 5.0.0
5
+ -----
6
+
7
+ * added `$useNaturalSort` argument to `Finder::sortByName()`
8
+
9
+ 4.3.0
10
+ -----
11
+
12
+ * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore
13
+
14
+ 4.2.0
15
+ -----
16
+
17
+ * added $useNaturalSort option to Finder::sortByName() method
18
+ * the `Finder::sortByName()` method will have a new `$useNaturalSort`
19
+ argument in version 5.0, not defining it is deprecated
20
+ * added `Finder::reverseSorting()` to reverse the sorting
21
+
22
+ 4.0.0
23
+ -----
24
+
25
+ * removed `ExceptionInterface`
26
+ * removed `Symfony\Component\Finder\Iterator\FilterIterator`
27
+
28
  3.4.0
29
  -----
30
 
vendor/symfony/finder/Comparator/Comparator.php CHANGED
@@ -31,12 +31,7 @@ class Comparator
31
  return $this->target;
32
  }
33
 
34
- /**
35
- * Sets the target value.
36
- *
37
- * @param string $target The target value
38
- */
39
- public function setTarget($target)
40
  {
41
  $this->target = $target;
42
  }
@@ -54,13 +49,11 @@ class Comparator
54
  /**
55
  * Sets the comparison operator.
56
  *
57
- * @param string $operator A valid operator
58
- *
59
  * @throws \InvalidArgumentException
60
  */
61
- public function setOperator($operator)
62
  {
63
- if (!$operator) {
64
  $operator = '==';
65
  }
66
 
31
  return $this->target;
32
  }
33
 
34
+ public function setTarget(string $target)
 
 
 
 
 
35
  {
36
  $this->target = $target;
37
  }
49
  /**
50
  * Sets the comparison operator.
51
  *
 
 
52
  * @throws \InvalidArgumentException
53
  */
54
+ public function setOperator(string $operator)
55
  {
56
+ if ('' === $operator) {
57
  $operator = '==';
58
  }
59
 
vendor/symfony/finder/Comparator/DateComparator.php CHANGED
@@ -23,7 +23,7 @@ class DateComparator extends Comparator
23
  *
24
  * @throws \InvalidArgumentException If the test is not understood
25
  */
26
- public function __construct($test)
27
  {
28
  if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) {
29
  throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test));
@@ -36,7 +36,7 @@ class DateComparator extends Comparator
36
  throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2]));
37
  }
38
 
39
- $operator = isset($matches[1]) ? $matches[1] : '==';
40
  if ('since' === $operator || 'after' === $operator) {
41
  $operator = '>';
42
  }
23
  *
24
  * @throws \InvalidArgumentException If the test is not understood
25
  */
26
+ public function __construct(string $test)
27
  {
28
  if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) {
29
  throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test));
36
  throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2]));
37
  }
38
 
39
+ $operator = $matches[1] ?? '==';
40
  if ('since' === $operator || 'after' === $operator) {
41
  $operator = '>';
42
  }
vendor/symfony/finder/Comparator/NumberComparator.php CHANGED
@@ -39,7 +39,7 @@ class NumberComparator extends Comparator
39
  *
40
  * @throws \InvalidArgumentException If the test is not understood
41
  */
42
- public function __construct($test)
43
  {
44
  if (!preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) {
45
  throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test));
@@ -74,6 +74,6 @@ class NumberComparator extends Comparator
74
  }
75
 
76
  $this->setTarget($target);
77
- $this->setOperator(isset($matches[1]) ? $matches[1] : '==');
78
  }
79
  }
39
  *
40
  * @throws \InvalidArgumentException If the test is not understood
41
  */
42
+ public function __construct(?string $test)
43
  {
44
  if (!preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) {
45
  throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test));
74
  }
75
 
76
  $this->setTarget($target);
77
+ $this->setOperator($matches[1] ?? '==');
78
  }
79
  }
vendor/symfony/finder/Exception/{ExceptionInterface.php → DirectoryNotFoundException.php} RENAMED
@@ -12,14 +12,8 @@
12
  namespace Symfony\Component\Finder\Exception;
13
 
14
  /**
15
- * @author Jean-François Simon <contact@jfsimon.fr>
16
- *
17
- * @deprecated since 3.3, to be removed in 4.0.
18
  */
19
- interface ExceptionInterface
20
  {
21
- /**
22
- * @return \Symfony\Component\Finder\Adapter\AdapterInterface
23
- */
24
- public function getAdapter();
25
  }
12
  namespace Symfony\Component\Finder\Exception;
13
 
14
  /**
15
+ * @author Andreas Erhard <andreas.erhard@i-med.ac.at>
 
 
16
  */
17
+ class DirectoryNotFoundException extends \InvalidArgumentException
18
  {
 
 
 
 
19
  }
vendor/symfony/finder/Finder.php CHANGED
@@ -13,12 +13,14 @@ namespace Symfony\Component\Finder;
13
 
14
  use Symfony\Component\Finder\Comparator\DateComparator;
15
  use Symfony\Component\Finder\Comparator\NumberComparator;
 
16
  use Symfony\Component\Finder\Iterator\CustomFilterIterator;
17
  use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
18
  use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
19
  use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator;
20
  use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
21
  use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
 
22
  use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
23
  use Symfony\Component\Finder\Iterator\SortableIterator;
24
 
@@ -37,8 +39,9 @@ use Symfony\Component\Finder\Iterator\SortableIterator;
37
  */
38
  class Finder implements \IteratorAggregate, \Countable
39
  {
40
- const IGNORE_VCS_FILES = 1;
41
- const IGNORE_DOT_FILES = 2;
 
42
 
43
  private $mode = 0;
44
  private $names = [];
@@ -48,6 +51,7 @@ class Finder implements \IteratorAggregate, \Countable
48
  private $depths = [];
49
  private $sizes = [];
50
  private $followLinks = false;
 
51
  private $sort = false;
52
  private $ignore = 0;
53
  private $dirs = [];
@@ -107,17 +111,20 @@ class Finder implements \IteratorAggregate, \Countable
107
  *
108
  * $finder->depth('> 1') // the Finder will start matching at level 1.
109
  * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
 
110
  *
111
- * @param string|int $level The depth level expression
112
  *
113
  * @return $this
114
  *
115
  * @see DepthRangeFilterIterator
116
  * @see NumberComparator
117
  */
118
- public function depth($level)
119
  {
120
- $this->depths[] = new Comparator\NumberComparator($level);
 
 
121
 
122
  return $this;
123
  }
@@ -131,8 +138,9 @@ class Finder implements \IteratorAggregate, \Countable
131
  * $finder->date('until 2 days ago');
132
  * $finder->date('> now - 2 hours');
133
  * $finder->date('>= 2005-10-15');
 
134
  *
135
- * @param string $date A date range string
136
  *
137
  * @return $this
138
  *
@@ -140,9 +148,11 @@ class Finder implements \IteratorAggregate, \Countable
140
  * @see DateRangeFilterIterator
141
  * @see DateComparator
142
  */
143
- public function date($date)
144
  {
145
- $this->dates[] = new Comparator\DateComparator($date);
 
 
146
 
147
  return $this;
148
  }
@@ -155,16 +165,17 @@ class Finder implements \IteratorAggregate, \Countable
155
  * $finder->name('*.php')
156
  * $finder->name('/\.php$/') // same as above
157
  * $finder->name('test.php')
 
158
  *
159
- * @param string $pattern A pattern (a regexp, a glob, or a string)
160
  *
161
  * @return $this
162
  *
163
  * @see FilenameFilterIterator
164
  */
165
- public function name($pattern)
166
  {
167
- $this->names[] = $pattern;
168
 
169
  return $this;
170
  }
@@ -172,15 +183,15 @@ class Finder implements \IteratorAggregate, \Countable
172
  /**
173
  * Adds rules that files must not match.
174
  *
175
- * @param string $pattern A pattern (a regexp, a glob, or a string)
176
  *
177
  * @return $this
178
  *
179
  * @see FilenameFilterIterator
180
  */
181
- public function notName($pattern)
182
  {
183
- $this->notNames[] = $pattern;
184
 
185
  return $this;
186
  }
@@ -192,16 +203,17 @@ class Finder implements \IteratorAggregate, \Countable
192
  *
193
  * $finder->contains('Lorem ipsum')
194
  * $finder->contains('/Lorem ipsum/i')
 
195
  *
196
- * @param string $pattern A pattern (string or regexp)
197
  *
198
  * @return $this
199
  *
200
  * @see FilecontentFilterIterator
201
  */
202
- public function contains($pattern)
203
  {
204
- $this->contains[] = $pattern;
205
 
206
  return $this;
207
  }
@@ -213,16 +225,17 @@ class Finder implements \IteratorAggregate, \Countable
213
  *
214
  * $finder->notContains('Lorem ipsum')
215
  * $finder->notContains('/Lorem ipsum/i')
 
216
  *
217
- * @param string $pattern A pattern (string or regexp)
218
  *
219
  * @return $this
220
  *
221
  * @see FilecontentFilterIterator
222
  */
223
- public function notContains($pattern)
224
  {
225
- $this->notContains[] = $pattern;
226
 
227
  return $this;
228
  }
@@ -234,18 +247,19 @@ class Finder implements \IteratorAggregate, \Countable
234
  *
235
  * $finder->path('some/special/dir')
236
  * $finder->path('/some\/special\/dir/') // same as above
 
237
  *
238
  * Use only / as dirname separator.
239
  *
240
- * @param string $pattern A pattern (a regexp or a string)
241
  *
242
  * @return $this
243
  *
244
  * @see FilenameFilterIterator
245
  */
246
- public function path($pattern)
247
  {
248
- $this->paths[] = $pattern;
249
 
250
  return $this;
251
  }
@@ -257,18 +271,19 @@ class Finder implements \IteratorAggregate, \Countable
257
  *
258
  * $finder->notPath('some/special/dir')
259
  * $finder->notPath('/some\/special\/dir/') // same as above
 
260
  *
261
  * Use only / as dirname separator.
262
  *
263
- * @param string $pattern A pattern (a regexp or a string)
264
  *
265
  * @return $this
266
  *
267
  * @see FilenameFilterIterator
268
  */
269
- public function notPath($pattern)
270
  {
271
- $this->notPaths[] = $pattern;
272
 
273
  return $this;
274
  }
@@ -279,17 +294,20 @@ class Finder implements \IteratorAggregate, \Countable
279
  * $finder->size('> 10K');
280
  * $finder->size('<= 1Ki');
281
  * $finder->size(4);
 
282
  *
283
- * @param string|int $size A size range string or an integer
284
  *
285
  * @return $this
286
  *
287
  * @see SizeRangeFilterIterator
288
  * @see NumberComparator
289
  */
290
- public function size($size)
291
  {
292
- $this->sizes[] = new Comparator\NumberComparator($size);
 
 
293
 
294
  return $this;
295
  }
@@ -319,13 +337,11 @@ class Finder implements \IteratorAggregate, \Countable
319
  *
320
  * This option is enabled by default.
321
  *
322
- * @param bool $ignoreDotFiles Whether to exclude "hidden" files or not
323
- *
324
  * @return $this
325
  *
326
  * @see ExcludeDirectoryFilterIterator
327
  */
328
- public function ignoreDotFiles($ignoreDotFiles)
329
  {
330
  if ($ignoreDotFiles) {
331
  $this->ignore |= static::IGNORE_DOT_FILES;
@@ -341,13 +357,11 @@ class Finder implements \IteratorAggregate, \Countable
341
  *
342
  * This option is enabled by default.
343
  *
344
- * @param bool $ignoreVCS Whether to exclude VCS files or not
345
- *
346
  * @return $this
347
  *
348
  * @see ExcludeDirectoryFilterIterator
349
  */
350
- public function ignoreVCS($ignoreVCS)
351
  {
352
  if ($ignoreVCS) {
353
  $this->ignore |= static::IGNORE_VCS_FILES;
@@ -358,6 +372,24 @@ class Finder implements \IteratorAggregate, \Countable
358
  return $this;
359
  }
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  /**
362
  * Adds VCS patterns.
363
  *
@@ -401,9 +433,9 @@ class Finder implements \IteratorAggregate, \Countable
401
  *
402
  * @see SortableIterator
403
  */
404
- public function sortByName()
405
  {
406
- $this->sort = Iterator\SortableIterator::SORT_BY_NAME;
407
 
408
  return $this;
409
  }
@@ -442,6 +474,18 @@ class Finder implements \IteratorAggregate, \Countable
442
  return $this;
443
  }
444
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  /**
446
  * Sorts files and directories by the last inode changed time.
447
  *
@@ -514,13 +558,11 @@ class Finder implements \IteratorAggregate, \Countable
514
  *
515
  * By default, scanning unreadable directories content throws an AccessDeniedException.
516
  *
517
- * @param bool $ignore
518
- *
519
  * @return $this
520
  */
521
- public function ignoreUnreadableDirs($ignore = true)
522
  {
523
- $this->ignoreUnreadableDirs = (bool) $ignore;
524
 
525
  return $this;
526
  }
@@ -532,7 +574,7 @@ class Finder implements \IteratorAggregate, \Countable
532
  *
533
  * @return $this
534
  *
535
- * @throws \InvalidArgumentException if one of the directories does not exist
536
  */
537
  public function in($dirs)
538
  {
@@ -545,7 +587,7 @@ class Finder implements \IteratorAggregate, \Countable
545
  sort($glob);
546
  $resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob));
547
  } else {
548
- throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
549
  }
550
  }
551
 
@@ -570,18 +612,30 @@ class Finder implements \IteratorAggregate, \Countable
570
  }
571
 
572
  if (1 === \count($this->dirs) && 0 === \count($this->iterators)) {
573
- return $this->searchInDirectory($this->dirs[0]);
 
 
 
 
 
 
574
  }
575
 
576
  $iterator = new \AppendIterator();
577
  foreach ($this->dirs as $dir) {
578
- $iterator->append($this->searchInDirectory($dir));
 
 
579
  }
580
 
581
  foreach ($this->iterators as $it) {
582
  $iterator->append($it);
583
  }
584
 
 
 
 
 
585
  return $iterator;
586
  }
587
 
@@ -590,13 +644,11 @@ class Finder implements \IteratorAggregate, \Countable
590
  *
591
  * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
592
  *
593
- * @param iterable $iterator
594
- *
595
  * @return $this
596
  *
597
  * @throws \InvalidArgumentException when the given argument is not iterable
598
  */
599
- public function append($iterator)
600
  {
601
  if ($iterator instanceof \IteratorAggregate) {
602
  $this->iterators[] = $iterator->getIterator();
@@ -605,7 +657,8 @@ class Finder implements \IteratorAggregate, \Countable
605
  } elseif ($iterator instanceof \Traversable || \is_array($iterator)) {
606
  $it = new \ArrayIterator();
607
  foreach ($iterator as $file) {
608
- $it->append($file instanceof \SplFileInfo ? $file : new \SplFileInfo($file));
 
609
  }
610
  $this->iterators[] = $it;
611
  } else {
@@ -639,12 +692,7 @@ class Finder implements \IteratorAggregate, \Countable
639
  return iterator_count($this->getIterator());
640
  }
641
 
642
- /**
643
- * @param string $dir
644
- *
645
- * @return \Iterator
646
- */
647
- private function searchInDirectory($dir)
648
  {
649
  $exclude = $this->exclude;
650
  $notPaths = $this->notPaths;
@@ -657,6 +705,14 @@ class Finder implements \IteratorAggregate, \Countable
657
  $notPaths[] = '#(^|/)\..+(/|$)#';
658
  }
659
 
 
 
 
 
 
 
 
 
660
  $minDepth = 0;
661
  $maxDepth = \PHP_INT_MAX;
662
 
@@ -725,11 +781,6 @@ class Finder implements \IteratorAggregate, \Countable
725
  $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths);
726
  }
727
 
728
- if ($this->sort) {
729
- $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort);
730
- $iterator = $iteratorAggregate->getIterator();
731
- }
732
-
733
  return $iterator;
734
  }
735
 
@@ -737,12 +788,8 @@ class Finder implements \IteratorAggregate, \Countable
737
  * Normalizes given directory names by removing trailing slashes.
738
  *
739
  * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper
740
- *
741
- * @param string $dir
742
- *
743
- * @return string
744
  */
745
- private function normalizeDir($dir)
746
  {
747
  if ('/' === $dir) {
748
  return $dir;
13
 
14
  use Symfony\Component\Finder\Comparator\DateComparator;
15
  use Symfony\Component\Finder\Comparator\NumberComparator;
16
+ use Symfony\Component\Finder\Exception\DirectoryNotFoundException;
17
  use Symfony\Component\Finder\Iterator\CustomFilterIterator;
18
  use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
19
  use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
20
  use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator;
21
  use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
22
  use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
23
+ use Symfony\Component\Finder\Iterator\LazyIterator;
24
  use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
25
  use Symfony\Component\Finder\Iterator\SortableIterator;
26
 
39
  */
40
  class Finder implements \IteratorAggregate, \Countable
41
  {
42
+ public const IGNORE_VCS_FILES = 1;
43
+ public const IGNORE_DOT_FILES = 2;
44
+ public const IGNORE_VCS_IGNORED_FILES = 4;
45
 
46
  private $mode = 0;
47
  private $names = [];
51
  private $depths = [];
52
  private $sizes = [];
53
  private $followLinks = false;
54
+ private $reverseSorting = false;
55
  private $sort = false;
56
  private $ignore = 0;
57
  private $dirs = [];
111
  *
112
  * $finder->depth('> 1') // the Finder will start matching at level 1.
113
  * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
114
+ * $finder->depth(['>= 1', '< 3'])
115
  *
116
+ * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels
117
  *
118
  * @return $this
119
  *
120
  * @see DepthRangeFilterIterator
121
  * @see NumberComparator
122
  */
123
+ public function depth($levels)
124
  {
125
+ foreach ((array) $levels as $level) {
126
+ $this->depths[] = new Comparator\NumberComparator($level);
127
+ }
128
 
129
  return $this;
130
  }
138
  * $finder->date('until 2 days ago');
139
  * $finder->date('> now - 2 hours');
140
  * $finder->date('>= 2005-10-15');
141
+ * $finder->date(['>= 2005-10-15', '<= 2006-05-27']);
142
  *
143
+ * @param string|string[] $dates A date range string or an array of date ranges
144
  *
145
  * @return $this
146
  *
148
  * @see DateRangeFilterIterator
149
  * @see DateComparator
150
  */
151
+ public function date($dates)
152
  {
153
+ foreach ((array) $dates as $date) {
154
+ $this->dates[] = new Comparator\DateComparator($date);
155
+ }
156
 
157
  return $this;
158
  }
165
  * $finder->name('*.php')
166
  * $finder->name('/\.php$/') // same as above
167
  * $finder->name('test.php')
168
+ * $finder->name(['test.py', 'test.php'])
169
  *
170
+ * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns
171
  *
172
  * @return $this
173
  *
174
  * @see FilenameFilterIterator
175
  */
176
+ public function name($patterns)
177
  {
178
+ $this->names = array_merge($this->names, (array) $patterns);
179
 
180
  return $this;
181
  }
183
  /**
184
  * Adds rules that files must not match.
185
  *
186
+ * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns
187
  *
188
  * @return $this
189
  *
190
  * @see FilenameFilterIterator
191
  */
192
+ public function notName($patterns)
193
  {
194
+ $this->notNames = array_merge($this->notNames, (array) $patterns);
195
 
196
  return $this;
197
  }
203
  *
204
  * $finder->contains('Lorem ipsum')
205
  * $finder->contains('/Lorem ipsum/i')
206
+ * $finder->contains(['dolor', '/ipsum/i'])
207
  *
208
+ * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns
209
  *
210
  * @return $this
211
  *
212
  * @see FilecontentFilterIterator
213
  */
214
+ public function contains($patterns)
215
  {
216
+ $this->contains = array_merge($this->contains, (array) $patterns);
217
 
218
  return $this;
219
  }
225
  *
226
  * $finder->notContains('Lorem ipsum')
227
  * $finder->notContains('/Lorem ipsum/i')
228
+ * $finder->notContains(['lorem', '/dolor/i'])
229
  *
230
+ * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns
231
  *
232
  * @return $this
233
  *
234
  * @see FilecontentFilterIterator
235
  */
236
+ public function notContains($patterns)
237
  {
238
+ $this->notContains = array_merge($this->notContains, (array) $patterns);
239
 
240
  return $this;
241
  }
247
  *
248
  * $finder->path('some/special/dir')
249
  * $finder->path('/some\/special\/dir/') // same as above
250
+ * $finder->path(['some dir', 'another/dir'])
251
  *
252
  * Use only / as dirname separator.
253
  *
254
+ * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns
255
  *
256
  * @return $this
257
  *
258
  * @see FilenameFilterIterator
259
  */
260
+ public function path($patterns)
261
  {
262
+ $this->paths = array_merge($this->paths, (array) $patterns);
263
 
264
  return $this;
265
  }
271
  *
272
  * $finder->notPath('some/special/dir')
273
  * $finder->notPath('/some\/special\/dir/') // same as above
274
+ * $finder->notPath(['some/file.txt', 'another/file.log'])
275
  *
276
  * Use only / as dirname separator.
277
  *
278
+ * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns
279
  *
280
  * @return $this
281
  *
282
  * @see FilenameFilterIterator
283
  */
284
+ public function notPath($patterns)
285
  {
286
+ $this->notPaths = array_merge($this->notPaths, (array) $patterns);
287
 
288
  return $this;
289
  }
294
  * $finder->size('> 10K');
295
  * $finder->size('<= 1Ki');
296
  * $finder->size(4);
297
+ * $finder->size(['> 10K', '< 20K'])
298
  *
299
+ * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges
300
  *
301
  * @return $this
302
  *
303
  * @see SizeRangeFilterIterator
304
  * @see NumberComparator
305
  */
306
+ public function size($sizes)
307
  {
308
+ foreach ((array) $sizes as $size) {
309
+ $this->sizes[] = new Comparator\NumberComparator($size);
310
+ }
311
 
312
  return $this;
313
  }
337
  *
338
  * This option is enabled by default.
339
  *
 
 
340
  * @return $this
341
  *
342
  * @see ExcludeDirectoryFilterIterator
343
  */
344
+ public function ignoreDotFiles(bool $ignoreDotFiles)
345
  {
346
  if ($ignoreDotFiles) {
347
  $this->ignore |= static::IGNORE_DOT_FILES;
357
  *
358
  * This option is enabled by default.
359
  *
 
 
360
  * @return $this
361
  *
362
  * @see ExcludeDirectoryFilterIterator
363
  */
364
+ public function ignoreVCS(bool $ignoreVCS)
365
  {
366
  if ($ignoreVCS) {
367
  $this->ignore |= static::IGNORE_VCS_FILES;
372
  return $this;
373
  }
374
 
375
+ /**
376
+ * Forces Finder to obey .gitignore and ignore files based on rules listed there.
377
+ *
378
+ * This option is disabled by default.
379
+ *
380
+ * @return $this
381
+ */
382
+ public function ignoreVCSIgnored(bool $ignoreVCSIgnored)
383
+ {
384
+ if ($ignoreVCSIgnored) {
385
+ $this->ignore |= static::IGNORE_VCS_IGNORED_FILES;
386
+ } else {
387
+ $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES;
388
+ }
389
+
390
+ return $this;
391
+ }
392
+
393
  /**
394
  * Adds VCS patterns.
395
  *
433
  *
434
  * @see SortableIterator
435
  */
436
+ public function sortByName(bool $useNaturalSort = false)
437
  {
438
+ $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME;
439
 
440
  return $this;
441
  }
474
  return $this;
475
  }
476
 
477
+ /**
478
+ * Reverses the sorting.
479
+ *
480
+ * @return $this
481
+ */
482
+ public function reverseSorting()
483
+ {
484
+ $this->reverseSorting = true;
485
+
486
+ return $this;
487
+ }
488
+
489
  /**
490
  * Sorts files and directories by the last inode changed time.
491
  *
558
  *
559
  * By default, scanning unreadable directories content throws an AccessDeniedException.
560
  *
 
 
561
  * @return $this
562
  */
563
+ public function ignoreUnreadableDirs(bool $ignore = true)
564
  {
565
+ $this->ignoreUnreadableDirs = $ignore;
566
 
567
  return $this;
568
  }
574
  *
575
  * @return $this
576
  *
577
+ * @throws DirectoryNotFoundException if one of the directories does not exist
578
  */
579
  public function in($dirs)
580
  {
587
  sort($glob);
588
  $resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob));
589
  } else {
590
+ throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir));
591
  }
592
  }
593
 
612
  }
613
 
614
  if (1 === \count($this->dirs) && 0 === \count($this->iterators)) {
615
+ $iterator = $this->searchInDirectory($this->dirs[0]);
616
+
617
+ if ($this->sort || $this->reverseSorting) {
618
+ $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
619
+ }
620
+
621
+ return $iterator;
622
  }
623
 
624
  $iterator = new \AppendIterator();
625
  foreach ($this->dirs as $dir) {
626
+ $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) {
627
+ return $this->searchInDirectory($dir);
628
+ })));
629
  }
630
 
631
  foreach ($this->iterators as $it) {
632
  $iterator->append($it);
633
  }
634
 
635
+ if ($this->sort || $this->reverseSorting) {
636
+ $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
637
+ }
638
+
639
  return $iterator;
640
  }
641
 
644
  *
645
  * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
646
  *
 
 
647
  * @return $this
648
  *
649
  * @throws \InvalidArgumentException when the given argument is not iterable
650
  */
651
+ public function append(iterable $iterator)
652
  {
653
  if ($iterator instanceof \IteratorAggregate) {
654
  $this->iterators[] = $iterator->getIterator();
657
  } elseif ($iterator instanceof \Traversable || \is_array($iterator)) {
658
  $it = new \ArrayIterator();
659
  foreach ($iterator as $file) {
660
+ $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file);
661
+ $it[$file->getPathname()] = $file;
662
  }
663
  $this->iterators[] = $it;
664
  } else {
692
  return iterator_count($this->getIterator());
693
  }
694
 
695
+ private function searchInDirectory(string $dir): \Iterator
 
 
 
 
 
696
  {
697
  $exclude = $this->exclude;
698
  $notPaths = $this->notPaths;
705
  $notPaths[] = '#(^|/)\..+(/|$)#';
706
  }
707
 
708
+ if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) {
709
+ $gitignoreFilePath = sprintf('%s/.gitignore', $dir);
710
+ if (!is_readable($gitignoreFilePath)) {
711
+ throw new \RuntimeException(sprintf('The "ignoreVCSIgnored" option cannot be used by the Finder as the "%s" file is not readable.', $gitignoreFilePath));
712
+ }
713
+ $notPaths = array_merge($notPaths, [Gitignore::toRegex(file_get_contents($gitignoreFilePath))]);
714
+ }
715
+
716
  $minDepth = 0;
717
  $maxDepth = \PHP_INT_MAX;
718
 
781
  $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths);
782
  }
783
 
 
 
 
 
 
784
  return $iterator;
785
  }
786
 
788
  * Normalizes given directory names by removing trailing slashes.
789
  *
790
  * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper
 
 
 
 
791
  */
792
+ private function normalizeDir(string $dir): string
793
  {
794
  if ('/' === $dir) {
795
  return $dir;
vendor/symfony/finder/Gitignore.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony\Component\Finder;
13
+
14
+ /**
15
+ * Gitignore matches against text.
16
+ *
17
+ * @author Ahmed Abdou <mail@ahmd.io>
18
+ */
19
+ class Gitignore
20
+ {
21
+ /**
22
+ * Returns a regexp which is the equivalent of the gitignore pattern.
23
+ *
24
+ * @return string The regexp
25
+ */
26
+ public static function toRegex(string $gitignoreFileContent): string
27
+ {
28
+ $gitignoreFileContent = preg_replace('/^[^\\\r\n]*#.*/m', '', $gitignoreFileContent);
29
+ $gitignoreLines = preg_split('/\r\n|\r|\n/', $gitignoreFileContent);
30
+
31
+ $positives = [];
32
+ $negatives = [];
33
+ foreach ($gitignoreLines as $i => $line) {
34
+ $line = trim($line);
35
+ if ('' === $line) {
36
+ continue;
37
+ }
38
+
39
+ if (1 === preg_match('/^!/', $line)) {
40
+ $positives[$i] = null;
41
+ $negatives[$i] = self::getRegexFromGitignore(preg_replace('/^!(.*)/', '${1}', $line), true);
42
+
43
+ continue;
44
+ }
45
+ $negatives[$i] = null;
46
+ $positives[$i] = self::getRegexFromGitignore($line);
47
+ }
48
+
49
+ $index = 0;
50
+ $patterns = [];
51
+ foreach ($positives as $pattern) {
52
+ if (null === $pattern) {
53
+ continue;
54
+ }
55
+
56
+ $negativesAfter = array_filter(\array_slice($negatives, ++$index));
57
+ if ([] !== $negativesAfter) {
58
+ $pattern .= sprintf('(?<!%s)', implode('|', $negativesAfter));
59
+ }
60
+
61
+ $patterns[] = $pattern;
62
+ }
63
+
64
+ return sprintf('/^((%s))$/', implode(')|(', $patterns));
65
+ }
66
+
67
+ private static function getRegexFromGitignore(string $gitignorePattern, bool $negative = false): string
68
+ {
69
+ $regex = '';
70
+ $isRelativePath = false;
71
+ // If there is a separator at the beginning or middle (or both) of the pattern, then the pattern is relative to the directory level of the particular .gitignore file itself
72
+ $slashPosition = strpos($gitignorePattern, '/');
73
+ if (false !== $slashPosition && \strlen($gitignorePattern) - 1 !== $slashPosition) {
74
+ if (0 === $slashPosition) {
75
+ $gitignorePattern = substr($gitignorePattern, 1);
76
+ }
77
+
78
+ $isRelativePath = true;
79
+ $regex .= '^';
80
+ }
81
+
82
+ if ('/' === $gitignorePattern[\strlen($gitignorePattern) - 1]) {
83
+ $gitignorePattern = substr($gitignorePattern, 0, -1);
84
+ }
85
+
86
+ $iMax = \strlen($gitignorePattern);
87
+ for ($i = 0; $i < $iMax; ++$i) {
88
+ $tripleChars = substr($gitignorePattern, $i, 3);
89
+ if ('**/' === $tripleChars || '/**' === $tripleChars) {
90
+ $regex .= '.*';
91
+ $i += 2;
92
+ continue;
93
+ }
94
+
95
+ $doubleChars = substr($gitignorePattern, $i, 2);
96
+ if ('**' === $doubleChars) {
97
+ $regex .= '.*';
98
+ ++$i;
99
+ continue;
100
+ }
101
+ if ('*/' === $doubleChars) {
102
+ $regex .= '[^\/]*\/?[^\/]*';
103
+ ++$i;
104
+ continue;
105
+ }
106
+
107
+ $c = $gitignorePattern[$i];
108
+ switch ($c) {
109
+ case '*':
110
+ $regex .= $isRelativePath ? '[^\/]*' : '[^\/]*\/?[^\/]*';
111
+ break;
112
+ case '/':
113
+ case '.':
114
+ case ':':
115
+ case '(':
116
+ case ')':
117
+ case '{':
118
+ case '}':
119
+ $regex .= '\\'.$c;
120
+ break;
121
+ default:
122
+ $regex .= $c;
123
+ }
124
+ }
125
+
126
+ if ($negative) {
127
+ // a lookbehind assertion has to be a fixed width (it can not have nested '|' statements)
128
+ return sprintf('%s$|%s\/$', $regex, $regex);
129
+ }
130
+
131
+ return '(?>'.$regex.'($|\/.*))';
132
+ }
133
+ }
vendor/symfony/finder/Glob.php CHANGED
@@ -38,14 +38,9 @@ class Glob
38
  /**
39
  * Returns a regexp which is the equivalent of the glob pattern.
40
  *
41
- * @param string $glob The glob pattern
42
- * @param bool $strictLeadingDot
43
- * @param bool $strictWildcardSlash
44
- * @param string $delimiter Optional delimiter
45
- *
46
- * @return string regex The regexp
47
  */
48
- public static function toRegex($glob, $strictLeadingDot = true, $strictWildcardSlash = true, $delimiter = '#')
49
  {
50
  $firstByte = true;
51
  $escaping = false;
38
  /**
39
  * Returns a regexp which is the equivalent of the glob pattern.
40
  *
41
+ * @return string
 
 
 
 
 
42
  */
43
+ public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#')
44
  {
45
  $firstByte = true;
46
  $escaping = false;
vendor/symfony/finder/Iterator/CustomFilterIterator.php CHANGED
@@ -19,7 +19,7 @@ namespace Symfony\Component\Finder\Iterator;
19
  *
20
  * @author Fabien Potencier <fabien@symfony.com>
21
  */
22
- class CustomFilterIterator extends FilterIterator
23
  {
24
  private $filters = [];
25
 
@@ -51,7 +51,7 @@ class CustomFilterIterator extends FilterIterator
51
  $fileinfo = $this->current();
52
 
53
  foreach ($this->filters as $filter) {
54
- if (false === \call_user_func($filter, $fileinfo)) {
55
  return false;
56
  }
57
  }
19
  *
20
  * @author Fabien Potencier <fabien@symfony.com>
21
  */
22
+ class CustomFilterIterator extends \FilterIterator
23
  {
24
  private $filters = [];
25
 
51
  $fileinfo = $this->current();
52
 
53
  foreach ($this->filters as $filter) {
54
+ if (false === $filter($fileinfo)) {
55
  return false;
56
  }
57
  }
vendor/symfony/finder/Iterator/DateRangeFilterIterator.php CHANGED
@@ -18,7 +18,7 @@ use Symfony\Component\Finder\Comparator\DateComparator;
18
  *
19
  * @author Fabien Potencier <fabien@symfony.com>
20
  */
21
- class DateRangeFilterIterator extends FilterIterator
22
  {
23
  private $comparators = [];
24
 
18
  *
19
  * @author Fabien Potencier <fabien@symfony.com>
20
  */
21
+ class DateRangeFilterIterator extends \FilterIterator
22
  {
23
  private $comparators = [];
24
 
vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php CHANGED
@@ -16,7 +16,7 @@ namespace Symfony\Component\Finder\Iterator;
16
  *
17
  * @author Fabien Potencier <fabien@symfony.com>
18
  */
19
- class DepthRangeFilterIterator extends FilterIterator
20
  {
21
  private $minDepth = 0;
22
 
@@ -25,7 +25,7 @@ class DepthRangeFilterIterator extends FilterIterator
25
  * @param int $minDepth The min depth
26
  * @param int $maxDepth The max depth
27
  */
28
- public function __construct(\RecursiveIteratorIterator $iterator, $minDepth = 0, $maxDepth = \PHP_INT_MAX)
29
  {
30
  $this->minDepth = $minDepth;
31
  $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth);
16
  *
17
  * @author Fabien Potencier <fabien@symfony.com>
18
  */
19
+ class DepthRangeFilterIterator extends \FilterIterator
20
  {
21
  private $minDepth = 0;
22
 
25
  * @param int $minDepth The min depth
26
  * @param int $maxDepth The max depth
27
  */
28
+ public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX)
29
  {
30
  $this->minDepth = $minDepth;
31
  $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth);
vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php CHANGED
@@ -16,7 +16,7 @@ namespace Symfony\Component\Finder\Iterator;
16
  *
17
  * @author Fabien Potencier <fabien@symfony.com>
18
  */
19
- class ExcludeDirectoryFilterIterator extends FilterIterator implements \RecursiveIterator
20
  {
21
  private $iterator;
22
  private $isRecursive;
@@ -68,6 +68,9 @@ class ExcludeDirectoryFilterIterator extends FilterIterator implements \Recursiv
68
  return true;
69
  }
70
 
 
 
 
71
  public function hasChildren()
72
  {
73
  return $this->isRecursive && $this->iterator->hasChildren();
16
  *
17
  * @author Fabien Potencier <fabien@symfony.com>
18
  */
19
+ class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator
20
  {
21
  private $iterator;
22
  private $isRecursive;
68
  return true;
69
  }
70
 
71
+ /**
72
+ * @return bool
73
+ */
74
  public function hasChildren()
75
  {
76
  return $this->isRecursive && $this->iterator->hasChildren();
vendor/symfony/finder/Iterator/FileTypeFilterIterator.php CHANGED
@@ -16,10 +16,10 @@ namespace Symfony\Component\Finder\Iterator;
16
  *
17
  * @author Fabien Potencier <fabien@symfony.com>
18
  */
19
- class FileTypeFilterIterator extends FilterIterator
20
  {
21
- const ONLY_FILES = 1;
22
- const ONLY_DIRECTORIES = 2;
23
 
24
  private $mode;
25
 
@@ -27,7 +27,7 @@ class FileTypeFilterIterator extends FilterIterator
27
  * @param \Iterator $iterator The Iterator to filter
28
  * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES)
29
  */
30
- public function __construct(\Iterator $iterator, $mode)
31
  {
32
  $this->mode = $mode;
33
 
16
  *
17
  * @author Fabien Potencier <fabien@symfony.com>
18
  */
19
+ class FileTypeFilterIterator extends \FilterIterator
20
  {
21
+ public const ONLY_FILES = 1;
22
+ public const ONLY_DIRECTORIES = 2;
23
 
24
  private $mode;
25
 
27
  * @param \Iterator $iterator The Iterator to filter
28
  * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES)
29
  */
30
+ public function __construct(\Iterator $iterator, int $mode)
31
  {
32
  $this->mode = $mode;
33
 
vendor/symfony/finder/Iterator/FilecontentFilterIterator.php CHANGED
@@ -51,7 +51,7 @@ class FilecontentFilterIterator extends MultiplePcreFilterIterator
51
  *
52
  * @return string regexp corresponding to a given string or regexp
53
  */
54
- protected function toRegex($str)
55
  {
56
  return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/';
57
  }
51
  *
52
  * @return string regexp corresponding to a given string or regexp
53
  */
54
+ protected function toRegex(string $str)
55
  {
56
  return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/';
57
  }
vendor/symfony/finder/Iterator/FilenameFilterIterator.php CHANGED
@@ -40,7 +40,7 @@ class FilenameFilterIterator extends MultiplePcreFilterIterator
40
  *
41
  * @return string regexp corresponding to a given glob or regexp
42
  */
43
- protected function toRegex($str)
44
  {
45
  return $this->isRegex($str) ? $str : Glob::toRegex($str);
46
  }
40
  *
41
  * @return string regexp corresponding to a given glob or regexp
42
  */
43
+ protected function toRegex(string $str)
44
  {
45
  return $this->isRegex($str) ? $str : Glob::toRegex($str);
46
  }
vendor/symfony/finder/Iterator/FilterIterator.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Iterator;
13
-
14
- /**
15
- * This iterator just overrides the rewind method in order to correct a PHP bug,
16
- * which existed before version 5.5.23/5.6.7.
17
- *
18
- * @see https://bugs.php.net/68557
19
- *
20
- * @author Alex Bogomazov
21
- *
22
- * @deprecated since 3.4, to be removed in 4.0.
23
- */
24
- abstract class FilterIterator extends \FilterIterator
25
- {
26
- /**
27
- * This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after
28
- * rewind in some cases.
29
- *
30
- * @see FilterIterator::rewind()
31
- */
32
- public function rewind()
33
- {
34
- if (\PHP_VERSION_ID > 50607 || (\PHP_VERSION_ID > 50523 && \PHP_VERSION_ID < 50600)) {
35
- parent::rewind();
36
-
37
- return;
38
- }
39
-
40
- $iterator = $this;
41
- while ($iterator instanceof \OuterIterator) {
42
- $innerIterator = $iterator->getInnerIterator();
43
-
44
- if ($innerIterator instanceof RecursiveDirectoryIterator) {
45
- // this condition is necessary for iterators to work properly with non-local filesystems like ftp
46
- if ($innerIterator->isRewindable()) {
47
- $innerIterator->next();
48
- $innerIterator->rewind();
49
- }
50
- } elseif ($innerIterator instanceof \FilesystemIterator) {
51
- $innerIterator->next();
52
- $innerIterator->rewind();
53
- }
54
-
55
- $iterator = $innerIterator;
56
- }
57
-
58
- parent::rewind();
59
- }
60
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Iterator/LazyIterator.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony\Component\Finder\Iterator;
13
+
14
+ /**
15
+ * @author Jérémy Derussé <jeremy@derusse.com>
16
+ *
17
+ * @internal
18
+ */
19
+ class LazyIterator implements \IteratorAggregate
20
+ {
21
+ private $iteratorFactory;
22
+
23
+ public function __construct(callable $iteratorFactory)
24
+ {
25
+ $this->iteratorFactory = $iteratorFactory;
26
+ }
27
+
28
+ public function getIterator(): \Traversable
29
+ {
30
+ yield from ($this->iteratorFactory)();
31
+ }
32
+ }
vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php CHANGED
@@ -16,15 +16,15 @@ namespace Symfony\Component\Finder\Iterator;
16
  *
17
  * @author Fabien Potencier <fabien@symfony.com>
18
  */
19
- abstract class MultiplePcreFilterIterator extends FilterIterator
20
  {
21
  protected $matchRegexps = [];
22
  protected $noMatchRegexps = [];
23
 
24
  /**
25
  * @param \Iterator $iterator The Iterator to filter
26
- * @param array $matchPatterns An array of patterns that need to match
27
- * @param array $noMatchPatterns An array of patterns that need to not match
28
  */
29
  public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns)
30
  {
@@ -46,11 +46,9 @@ abstract class MultiplePcreFilterIterator extends FilterIterator
46
  * Such case can be handled by child classes before calling the method if they want to
47
  * apply a different behavior.
48
  *
49
- * @param string $string The string to be matched against filters
50
- *
51
  * @return bool
52
  */
53
- protected function isAccepted($string)
54
  {
55
  // should at least not match one rule to exclude
56
  foreach ($this->noMatchRegexps as $regex) {
@@ -77,11 +75,9 @@ abstract class MultiplePcreFilterIterator extends FilterIterator
77
  /**
78
  * Checks whether the string is a regex.
79
  *
80
- * @param string $str
81
- *
82
- * @return bool Whether the given string is a regex
83
  */
84
- protected function isRegex($str)
85
  {
86
  if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
87
  $start = substr($m[1], 0, 1);
@@ -104,9 +100,7 @@ abstract class MultiplePcreFilterIterator extends FilterIterator
104
  /**
105
  * Converts string into regexp.
106
  *
107
- * @param string $str Pattern
108
- *
109
- * @return string regexp corresponding to a given string
110
  */
111
- abstract protected function toRegex($str);
112
  }
16
  *
17
  * @author Fabien Potencier <fabien@symfony.com>
18
  */
19
+ abstract class MultiplePcreFilterIterator extends \FilterIterator
20
  {
21
  protected $matchRegexps = [];
22
  protected $noMatchRegexps = [];
23
 
24
  /**
25
  * @param \Iterator $iterator The Iterator to filter
26
+ * @param string[] $matchPatterns An array of patterns that need to match
27
+ * @param string[] $noMatchPatterns An array of patterns that need to not match
28
  */
29
  public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns)
30
  {
46
  * Such case can be handled by child classes before calling the method if they want to
47
  * apply a different behavior.
48
  *
 
 
49
  * @return bool
50
  */
51
+ protected function isAccepted(string $string)
52
  {
53
  // should at least not match one rule to exclude
54
  foreach ($this->noMatchRegexps as $regex) {
75
  /**
76
  * Checks whether the string is a regex.
77
  *
78
+ * @return bool
 
 
79
  */
80
+ protected function isRegex(string $str)
81
  {
82
  if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
83
  $start = substr($m[1], 0, 1);
100
  /**
101
  * Converts string into regexp.
102
  *
103
+ * @return string
 
 
104
  */
105
+ abstract protected function toRegex(string $str);
106
  }
vendor/symfony/finder/Iterator/PathFilterIterator.php CHANGED
@@ -49,7 +49,7 @@ class PathFilterIterator extends MultiplePcreFilterIterator
49
  *
50
  * @return string regexp corresponding to a given string or regexp
51
  */
52
- protected function toRegex($str)
53
  {
54
  return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/';
55
  }
49
  *
50
  * @return string regexp corresponding to a given string or regexp
51
  */
52
+ protected function toRegex(string $str)
53
  {
54
  return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/';
55
  }
vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php CHANGED
@@ -37,13 +37,9 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
37
  private $directorySeparator = '/';
38
 
39
  /**
40
- * @param string $path
41
- * @param int $flags
42
- * @param bool $ignoreUnreadableDirs
43
- *
44
  * @throws \RuntimeException
45
  */
46
- public function __construct($path, $flags, $ignoreUnreadableDirs = false)
47
  {
48
  if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) {
49
  throw new \RuntimeException('This iterator only support returning current as fileinfo.');
@@ -120,11 +116,6 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
120
  return;
121
  }
122
 
123
- // @see https://bugs.php.net/68557
124
- if (\PHP_VERSION_ID < 50523 || \PHP_VERSION_ID >= 50600 && \PHP_VERSION_ID < 50607) {
125
- parent::next();
126
- }
127
-
128
  parent::rewind();
129
  }
130
 
@@ -139,11 +130,6 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
139
  return $this->rewindable;
140
  }
141
 
142
- // workaround for an HHVM bug, should be removed when https://github.com/facebook/hhvm/issues/7281 is fixed
143
- if ('' === $this->getPath()) {
144
- return $this->rewindable = false;
145
- }
146
-
147
  if (false !== $stream = @opendir($this->getPath())) {
148
  $infos = stream_get_meta_data($stream);
149
  closedir($stream);
37
  private $directorySeparator = '/';
38
 
39
  /**
 
 
 
 
40
  * @throws \RuntimeException
41
  */
42
+ public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false)
43
  {
44
  if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) {
45
  throw new \RuntimeException('This iterator only support returning current as fileinfo.');
116
  return;
117
  }
118
 
 
 
 
 
 
119
  parent::rewind();
120
  }
121
 
130
  return $this->rewindable;
131
  }
132
 
 
 
 
 
 
133
  if (false !== $stream = @opendir($this->getPath())) {
134
  $infos = stream_get_meta_data($stream);
135
  closedir($stream);
vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php CHANGED
@@ -18,7 +18,7 @@ use Symfony\Component\Finder\Comparator\NumberComparator;
18
  *
19
  * @author Fabien Potencier <fabien@symfony.com>
20
  */
21
- class SizeRangeFilterIterator extends FilterIterator
22
  {
23
  private $comparators = [];
24
 
18
  *
19
  * @author Fabien Potencier <fabien@symfony.com>
20
  */
21
+ class SizeRangeFilterIterator extends \FilterIterator
22
  {
23
  private $comparators = [];
24
 
vendor/symfony/finder/Iterator/SortableIterator.php CHANGED
@@ -18,11 +18,13 @@ namespace Symfony\Component\Finder\Iterator;
18
  */
19
  class SortableIterator implements \IteratorAggregate
20
  {
21
- const SORT_BY_NAME = 1;
22
- const SORT_BY_TYPE = 2;
23
- const SORT_BY_ACCESSED_TIME = 3;
24
- const SORT_BY_CHANGED_TIME = 4;
25
- const SORT_BY_MODIFIED_TIME = 5;
 
 
26
 
27
  private $iterator;
28
  private $sort;
@@ -33,47 +35,66 @@ class SortableIterator implements \IteratorAggregate
33
  *
34
  * @throws \InvalidArgumentException
35
  */
36
- public function __construct(\Traversable $iterator, $sort)
37
  {
38
  $this->iterator = $iterator;
 
39
 
40
  if (self::SORT_BY_NAME === $sort) {
41
- $this->sort = static function ($a, $b) {
42
- return strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());
 
 
 
 
43
  };
44
  } elseif (self::SORT_BY_TYPE === $sort) {
45
- $this->sort = static function ($a, $b) {
46
  if ($a->isDir() && $b->isFile()) {
47
- return -1;
48
  } elseif ($a->isFile() && $b->isDir()) {
49
- return 1;
50
  }
51
 
52
- return strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());
53
  };
54
  } elseif (self::SORT_BY_ACCESSED_TIME === $sort) {
55
- $this->sort = static function ($a, $b) {
56
- return $a->getATime() - $b->getATime();
57
  };
58
  } elseif (self::SORT_BY_CHANGED_TIME === $sort) {
59
- $this->sort = static function ($a, $b) {
60
- return $a->getCTime() - $b->getCTime();
61
  };
62
  } elseif (self::SORT_BY_MODIFIED_TIME === $sort) {
63
- $this->sort = static function ($a, $b) {
64
- return $a->getMTime() - $b->getMTime();
65
  };
 
 
66
  } elseif (\is_callable($sort)) {
67
- $this->sort = $sort;
68
  } else {
69
  throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.');
70
  }
71
  }
72
 
 
 
 
73
  public function getIterator()
74
  {
 
 
 
 
75
  $array = iterator_to_array($this->iterator, true);
76
- uasort($array, $this->sort);
 
 
 
 
 
77
 
78
  return new \ArrayIterator($array);
79
  }
18
  */
19
  class SortableIterator implements \IteratorAggregate
20
  {
21
+ public const SORT_BY_NONE = 0;
22
+ public const SORT_BY_NAME = 1;
23
+ public const SORT_BY_TYPE = 2;
24
+ public const SORT_BY_ACCESSED_TIME = 3;
25
+ public const SORT_BY_CHANGED_TIME = 4;
26
+ public const SORT_BY_MODIFIED_TIME = 5;
27
+ public const SORT_BY_NAME_NATURAL = 6;
28
 
29
  private $iterator;
30
  private $sort;
35
  *
36
  * @throws \InvalidArgumentException
37
  */
38
+ public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false)
39
  {
40
  $this->iterator = $iterator;
41
+ $order = $reverseOrder ? -1 : 1;
42
 
43
  if (self::SORT_BY_NAME === $sort) {
44
+ $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) {
45
+ return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());
46
+ };
47
+ } elseif (self::SORT_BY_NAME_NATURAL === $sort) {
48
+ $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) {
49
+ return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());
50
  };
51
  } elseif (self::SORT_BY_TYPE === $sort) {
52
+ $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) {
53
  if ($a->isDir() && $b->isFile()) {
54
+ return -$order;
55
  } elseif ($a->isFile() && $b->isDir()) {
56
+ return $order;
57
  }
58
 
59
+ return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());
60
  };
61
  } elseif (self::SORT_BY_ACCESSED_TIME === $sort) {
62
+ $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) {
63
+ return $order * ($a->getATime() - $b->getATime());
64
  };
65
  } elseif (self::SORT_BY_CHANGED_TIME === $sort) {
66
+ $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) {
67
+ return $order * ($a->getCTime() - $b->getCTime());
68
  };
69
  } elseif (self::SORT_BY_MODIFIED_TIME === $sort) {
70
+ $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) {
71
+ return $order * ($a->getMTime() - $b->getMTime());
72
  };
73
+ } elseif (self::SORT_BY_NONE === $sort) {
74
+ $this->sort = $order;
75
  } elseif (\is_callable($sort)) {
76
+ $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort;
77
  } else {
78
  throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.');
79
  }
80
  }
81
 
82
+ /**
83
+ * @return \Traversable
84
+ */
85
  public function getIterator()
86
  {
87
+ if (1 === $this->sort) {
88
+ return $this->iterator;
89
+ }
90
+
91
  $array = iterator_to_array($this->iterator, true);
92
+
93
+ if (-1 === $this->sort) {
94
+ $array = array_reverse($array);
95
+ } else {
96
+ uasort($array, $this->sort);
97
+ }
98
 
99
  return new \ArrayIterator($array);
100
  }
vendor/symfony/finder/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2020 Fabien Potencier
2
 
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
  of this software and associated documentation files (the "Software"), to deal
1
+ Copyright (c) 2004-2021 Fabien Potencier
2
 
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
  of this software and associated documentation files (the "Software"), to deal
vendor/symfony/finder/SplFileInfo.php CHANGED
@@ -26,7 +26,7 @@ class SplFileInfo extends \SplFileInfo
26
  * @param string $relativePath The relative path
27
  * @param string $relativePathname The relative path name
28
  */
29
- public function __construct($file, $relativePath, $relativePathname)
30
  {
31
  parent::__construct($file);
32
  $this->relativePath = $relativePath;
@@ -57,6 +57,13 @@ class SplFileInfo extends \SplFileInfo
57
  return $this->relativePathname;
58
  }
59
 
 
 
 
 
 
 
 
60
  /**
61
  * Returns the contents of the file.
62
  *
26
  * @param string $relativePath The relative path
27
  * @param string $relativePathname The relative path name
28
  */
29
+ public function __construct(string $file, string $relativePath, string $relativePathname)
30
  {
31
  parent::__construct($file);
32
  $this->relativePath = $relativePath;
57
  return $this->relativePathname;
58
  }
59
 
60
+ public function getFilenameWithoutExtension(): string
61
+ {
62
+ $filename = $this->getFilename();
63
+
64
+ return pathinfo($filename, \PATHINFO_FILENAME);
65
+ }
66
+
67
  /**
68
  * Returns the contents of the file.
69
  *
vendor/symfony/finder/Tests/Comparator/ComparatorTest.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Comparator;
13
-
14
- use PHPUnit\Framework\TestCase;
15
- use Symfony\Component\Finder\Comparator\Comparator;
16
-
17
- class ComparatorTest extends TestCase
18
- {
19
- public function testGetSetOperator()
20
- {
21
- $comparator = new Comparator();
22
- try {
23
- $comparator->setOperator('foo');
24
- $this->fail('->setOperator() throws an \InvalidArgumentException if the operator is not valid.');
25
- } catch (\Exception $e) {
26
- $this->assertInstanceOf('InvalidArgumentException', $e, '->setOperator() throws an \InvalidArgumentException if the operator is not valid.');
27
- }
28
-
29
- $comparator = new Comparator();
30
- $comparator->setOperator('>');
31
- $this->assertEquals('>', $comparator->getOperator(), '->getOperator() returns the current operator');
32
- }
33
-
34
- public function testGetSetTarget()
35
- {
36
- $comparator = new Comparator();
37
- $comparator->setTarget(8);
38
- $this->assertEquals(8, $comparator->getTarget(), '->getTarget() returns the target');
39
- }
40
-
41
- /**
42
- * @dataProvider getTestData
43
- */
44
- public function testTest($operator, $target, $match, $noMatch)
45
- {
46
- $c = new Comparator();
47
- $c->setOperator($operator);
48
- $c->setTarget($target);
49
-
50
- foreach ($match as $m) {
51
- $this->assertTrue($c->test($m), '->test() tests a string against the expression');
52
- }
53
-
54
- foreach ($noMatch as $m) {
55
- $this->assertFalse($c->test($m), '->test() tests a string against the expression');
56
- }
57
- }
58
-
59
- public function getTestData()
60
- {
61
- return [
62
- ['<', '1000', ['500', '999'], ['1000', '1500']],
63
- ];
64
- }
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Comparator/DateComparatorTest.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Comparator;
13
-
14
- use PHPUnit\Framework\TestCase;
15
- use Symfony\Component\Finder\Comparator\DateComparator;
16
-
17
- class DateComparatorTest extends TestCase
18
- {
19
- public function testConstructor()
20
- {
21
- try {
22
- new DateComparator('foobar');
23
- $this->fail('__construct() throws an \InvalidArgumentException if the test expression is not valid.');
24
- } catch (\Exception $e) {
25
- $this->assertInstanceOf('InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException if the test expression is not valid.');
26
- }
27
-
28
- try {
29
- new DateComparator('');
30
- $this->fail('__construct() throws an \InvalidArgumentException if the test expression is not valid.');
31
- } catch (\Exception $e) {
32
- $this->assertInstanceOf('InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException if the test expression is not valid.');
33
- }
34
- }
35
-
36
- /**
37
- * @dataProvider getTestData
38
- */
39
- public function testTest($test, $match, $noMatch)
40
- {
41
- $c = new DateComparator($test);
42
-
43
- foreach ($match as $m) {
44
- $this->assertTrue($c->test($m), '->test() tests a string against the expression');
45
- }
46
-
47
- foreach ($noMatch as $m) {
48
- $this->assertFalse($c->test($m), '->test() tests a string against the expression');
49
- }
50
- }
51
-
52
- public function getTestData()
53
- {
54
- return [
55
- ['< 2005-10-10', [strtotime('2005-10-09')], [strtotime('2005-10-15')]],
56
- ['until 2005-10-10', [strtotime('2005-10-09')], [strtotime('2005-10-15')]],
57
- ['before 2005-10-10', [strtotime('2005-10-09')], [strtotime('2005-10-15')]],
58
- ['> 2005-10-10', [strtotime('2005-10-15')], [strtotime('2005-10-09')]],
59
- ['after 2005-10-10', [strtotime('2005-10-15')], [strtotime('2005-10-09')]],
60
- ['since 2005-10-10', [strtotime('2005-10-15')], [strtotime('2005-10-09')]],
61
- ['!= 2005-10-10', [strtotime('2005-10-11')], [strtotime('2005-10-10')]],
62
- ];
63
- }
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Comparator/NumberComparatorTest.php DELETED
@@ -1,108 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Comparator;
13
-
14
- use PHPUnit\Framework\TestCase;
15
- use Symfony\Component\Finder\Comparator\NumberComparator;
16
-
17
- class NumberComparatorTest extends TestCase
18
- {
19
- /**
20
- * @dataProvider getConstructorTestData
21
- */
22
- public function testConstructor($successes, $failures)
23
- {
24
- foreach ($successes as $s) {
25
- new NumberComparator($s);
26
- }
27
-
28
- foreach ($failures as $f) {
29
- try {
30
- new NumberComparator($f);
31
- $this->fail('__construct() throws an \InvalidArgumentException if the test expression is not valid.');
32
- } catch (\Exception $e) {
33
- $this->assertInstanceOf('InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException if the test expression is not valid.');
34
- }
35
- }
36
- }
37
-
38
- /**
39
- * @dataProvider getTestData
40
- */
41
- public function testTest($test, $match, $noMatch)
42
- {
43
- $c = new NumberComparator($test);
44
-
45
- foreach ($match as $m) {
46
- $this->assertTrue($c->test($m), '->test() tests a string against the expression');
47
- }
48
-
49
- foreach ($noMatch as $m) {
50
- $this->assertFalse($c->test($m), '->test() tests a string against the expression');
51
- }
52
- }
53
-
54
- public function getTestData()
55
- {
56
- return [
57
- ['< 1000', ['500', '999'], ['1000', '1500']],
58
-
59
- ['< 1K', ['500', '999'], ['1000', '1500']],
60
- ['<1k', ['500', '999'], ['1000', '1500']],
61
- [' < 1 K ', ['500', '999'], ['1000', '1500']],
62
- ['<= 1K', ['1000'], ['1001']],
63
- ['> 1K', ['1001'], ['1000']],
64
- ['>= 1K', ['1000'], ['999']],
65
-
66
- ['< 1KI', ['500', '1023'], ['1024', '1500']],
67
- ['<= 1KI', ['1024'], ['1025']],
68
- ['> 1KI', ['1025'], ['1024']],
69
- ['>= 1KI', ['1024'], ['1023']],
70
-
71
- ['1KI', ['1024'], ['1023', '1025']],
72
- ['==1KI', ['1024'], ['1023', '1025']],
73
-
74
- ['==1m', ['1000000'], ['999999', '1000001']],
75
- ['==1mi', [1024 * 1024], [1024 * 1024 - 1, 1024 * 1024 + 1]],
76
-
77
- ['==1g', ['1000000000'], ['999999999', '1000000001']],
78
- ['==1gi', [1024 * 1024 * 1024], [1024 * 1024 * 1024 - 1, 1024 * 1024 * 1024 + 1]],
79
-
80
- ['!= 1000', ['500', '999'], ['1000']],
81
- ];
82
- }
83
-
84
- public function getConstructorTestData()
85
- {
86
- return [
87
- [
88
- [
89
- '1', '0',
90
- '3.5', '33.55', '123.456', '123456.78',
91
- '.1', '.123',
92
- '.0', '0.0',
93
- '1.', '0.', '123.',
94
- '==1', '!=1', '<1', '>1', '<=1', '>=1',
95
- '==1k', '==1ki', '==1m', '==1mi', '==1g', '==1gi',
96
- '1k', '1ki', '1m', '1mi', '1g', '1gi',
97
- ],
98
- [
99
- false, null, '',
100
- ' ', 'foobar',
101
- '=1', '===1',
102
- '0 . 1', '123 .45', '234. 567',
103
- '..', '.0.', '0.1.2',
104
- ],
105
- ],
106
- ];
107
- }
108
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/FinderTest.php DELETED
@@ -1,752 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests;
13
-
14
- use Symfony\Component\Finder\Finder;
15
-
16
- class FinderTest extends Iterator\RealIteratorTestCase
17
- {
18
- public function testCreate()
19
- {
20
- $this->assertInstanceOf('Symfony\Component\Finder\Finder', Finder::create());
21
- }
22
-
23
- public function testDirectories()
24
- {
25
- $finder = $this->buildFinder();
26
- $this->assertSame($finder, $finder->directories());
27
- $this->assertIterator($this->toAbsolute(['foo', 'toto']), $finder->in(self::$tmpDir)->getIterator());
28
-
29
- $finder = $this->buildFinder();
30
- $finder->directories();
31
- $finder->files();
32
- $finder->directories();
33
- $this->assertIterator($this->toAbsolute(['foo', 'toto']), $finder->in(self::$tmpDir)->getIterator());
34
- }
35
-
36
- public function testFiles()
37
- {
38
- $finder = $this->buildFinder();
39
- $this->assertSame($finder, $finder->files());
40
- $this->assertIterator($this->toAbsolute(['foo/bar.tmp', 'test.php', 'test.py', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
41
-
42
- $finder = $this->buildFinder();
43
- $finder->files();
44
- $finder->directories();
45
- $finder->files();
46
- $this->assertIterator($this->toAbsolute(['foo/bar.tmp', 'test.php', 'test.py', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
47
- }
48
-
49
- public function testRemoveTrailingSlash()
50
- {
51
- $finder = $this->buildFinder();
52
-
53
- $expected = $this->toAbsolute(['foo/bar.tmp', 'test.php', 'test.py', 'foo bar']);
54
- $in = self::$tmpDir.'//';
55
-
56
- $this->assertIterator($expected, $finder->in($in)->files()->getIterator());
57
- }
58
-
59
- public function testSymlinksNotResolved()
60
- {
61
- if ('\\' === \DIRECTORY_SEPARATOR) {
62
- $this->markTestSkipped('symlinks are not supported on Windows');
63
- }
64
-
65
- $finder = $this->buildFinder();
66
-
67
- symlink($this->toAbsolute('foo'), $this->toAbsolute('baz'));
68
- $expected = $this->toAbsolute(['baz/bar.tmp']);
69
- $in = self::$tmpDir.'/baz/';
70
- try {
71
- $this->assertIterator($expected, $finder->in($in)->files()->getIterator());
72
- unlink($this->toAbsolute('baz'));
73
- } catch (\Exception $e) {
74
- unlink($this->toAbsolute('baz'));
75
- throw $e;
76
- }
77
- }
78
-
79
- public function testBackPathNotNormalized()
80
- {
81
- $finder = $this->buildFinder();
82
-
83
- $expected = $this->toAbsolute(['foo/../foo/bar.tmp']);
84
- $in = self::$tmpDir.'/foo/../foo/';
85
- $this->assertIterator($expected, $finder->in($in)->files()->getIterator());
86
- }
87
-
88
- public function testDepth()
89
- {
90
- $finder = $this->buildFinder();
91
- $this->assertSame($finder, $finder->depth('< 1'));
92
- $this->assertIterator($this->toAbsolute(['foo', 'test.php', 'test.py', 'toto', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
93
-
94
- $finder = $this->buildFinder();
95
- $this->assertSame($finder, $finder->depth('<= 0'));
96
- $this->assertIterator($this->toAbsolute(['foo', 'test.php', 'test.py', 'toto', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
97
-
98
- $finder = $this->buildFinder();
99
- $this->assertSame($finder, $finder->depth('>= 1'));
100
- $this->assertIterator($this->toAbsolute(['foo/bar.tmp']), $finder->in(self::$tmpDir)->getIterator());
101
-
102
- $finder = $this->buildFinder();
103
- $finder->depth('< 1')->depth('>= 1');
104
- $this->assertIterator([], $finder->in(self::$tmpDir)->getIterator());
105
- }
106
-
107
- public function testName()
108
- {
109
- $finder = $this->buildFinder();
110
- $this->assertSame($finder, $finder->name('*.php'));
111
- $this->assertIterator($this->toAbsolute(['test.php']), $finder->in(self::$tmpDir)->getIterator());
112
-
113
- $finder = $this->buildFinder();
114
- $finder->name('test.ph*');
115
- $finder->name('test.py');
116
- $this->assertIterator($this->toAbsolute(['test.php', 'test.py']), $finder->in(self::$tmpDir)->getIterator());
117
-
118
- $finder = $this->buildFinder();
119
- $finder->name('~^test~i');
120
- $this->assertIterator($this->toAbsolute(['test.php', 'test.py']), $finder->in(self::$tmpDir)->getIterator());
121
-
122
- $finder = $this->buildFinder();
123
- $finder->name('~\\.php$~i');
124
- $this->assertIterator($this->toAbsolute(['test.php']), $finder->in(self::$tmpDir)->getIterator());
125
-
126
- $finder = $this->buildFinder();
127
- $finder->name('test.p{hp,y}');
128
- $this->assertIterator($this->toAbsolute(['test.php', 'test.py']), $finder->in(self::$tmpDir)->getIterator());
129
- }
130
-
131
- public function testNotName()
132
- {
133
- $finder = $this->buildFinder();
134
- $this->assertSame($finder, $finder->notName('*.php'));
135
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.py', 'toto', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
136
-
137
- $finder = $this->buildFinder();
138
- $finder->notName('*.php');
139
- $finder->notName('*.py');
140
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'toto', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
141
-
142
- $finder = $this->buildFinder();
143
- $finder->name('test.ph*');
144
- $finder->name('test.py');
145
- $finder->notName('*.php');
146
- $finder->notName('*.py');
147
- $this->assertIterator([], $finder->in(self::$tmpDir)->getIterator());
148
-
149
- $finder = $this->buildFinder();
150
- $finder->name('test.ph*');
151
- $finder->name('test.py');
152
- $finder->notName('*.p{hp,y}');
153
- $this->assertIterator([], $finder->in(self::$tmpDir)->getIterator());
154
- }
155
-
156
- /**
157
- * @dataProvider getRegexNameTestData
158
- */
159
- public function testRegexName($regex)
160
- {
161
- $finder = $this->buildFinder();
162
- $finder->name($regex);
163
- $this->assertIterator($this->toAbsolute(['test.py', 'test.php']), $finder->in(self::$tmpDir)->getIterator());
164
- }
165
-
166
- public function testSize()
167
- {
168
- $finder = $this->buildFinder();
169
- $this->assertSame($finder, $finder->files()->size('< 1K')->size('> 500'));
170
- $this->assertIterator($this->toAbsolute(['test.php']), $finder->in(self::$tmpDir)->getIterator());
171
- }
172
-
173
- public function testDate()
174
- {
175
- $finder = $this->buildFinder();
176
- $this->assertSame($finder, $finder->files()->date('until last month'));
177
- $this->assertIterator($this->toAbsolute(['foo/bar.tmp', 'test.php']), $finder->in(self::$tmpDir)->getIterator());
178
- }
179
-
180
- public function testExclude()
181
- {
182
- $finder = $this->buildFinder();
183
- $this->assertSame($finder, $finder->exclude('foo'));
184
- $this->assertIterator($this->toAbsolute(['test.php', 'test.py', 'toto', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
185
- }
186
-
187
- public function testIgnoreVCS()
188
- {
189
- $finder = $this->buildFinder();
190
- $this->assertSame($finder, $finder->ignoreVCS(false)->ignoreDotFiles(false));
191
- $this->assertIterator($this->toAbsolute(['.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
192
-
193
- $finder = $this->buildFinder();
194
- $finder->ignoreVCS(false)->ignoreVCS(false)->ignoreDotFiles(false);
195
- $this->assertIterator($this->toAbsolute(['.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
196
-
197
- $finder = $this->buildFinder();
198
- $this->assertSame($finder, $finder->ignoreVCS(true)->ignoreDotFiles(false));
199
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
200
- }
201
-
202
- public function testIgnoreVCSCanBeDisabledAfterFirstIteration()
203
- {
204
- $finder = $this->buildFinder();
205
- $finder->in(self::$tmpDir);
206
- $finder->ignoreDotFiles(false);
207
-
208
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->getIterator());
209
-
210
- $finder->ignoreVCS(false);
211
- $this->assertIterator($this->toAbsolute(['.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->getIterator());
212
- }
213
-
214
- public function testIgnoreDotFiles()
215
- {
216
- $finder = $this->buildFinder();
217
- $this->assertSame($finder, $finder->ignoreDotFiles(false)->ignoreVCS(false));
218
- $this->assertIterator($this->toAbsolute(['.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
219
-
220
- $finder = $this->buildFinder();
221
- $finder->ignoreDotFiles(false)->ignoreDotFiles(false)->ignoreVCS(false);
222
- $this->assertIterator($this->toAbsolute(['.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
223
-
224
- $finder = $this->buildFinder();
225
- $this->assertSame($finder, $finder->ignoreDotFiles(true)->ignoreVCS(false));
226
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
227
- }
228
-
229
- public function testIgnoreDotFilesCanBeDisabledAfterFirstIteration()
230
- {
231
- $finder = $this->buildFinder();
232
- $finder->in(self::$tmpDir);
233
-
234
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar']), $finder->getIterator());
235
-
236
- $finder->ignoreDotFiles(false);
237
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar']), $finder->getIterator());
238
- }
239
-
240
- public function testSortByName()
241
- {
242
- $finder = $this->buildFinder();
243
- $this->assertSame($finder, $finder->sortByName());
244
- $this->assertIterator($this->toAbsolute(['foo', 'foo bar', 'foo/bar.tmp', 'test.php', 'test.py', 'toto']), $finder->in(self::$tmpDir)->getIterator());
245
- }
246
-
247
- public function testSortByType()
248
- {
249
- $finder = $this->buildFinder();
250
- $this->assertSame($finder, $finder->sortByType());
251
- $this->assertIterator($this->toAbsolute(['foo', 'foo bar', 'toto', 'foo/bar.tmp', 'test.php', 'test.py']), $finder->in(self::$tmpDir)->getIterator());
252
- }
253
-
254
- public function testSortByAccessedTime()
255
- {
256
- $finder = $this->buildFinder();
257
- $this->assertSame($finder, $finder->sortByAccessedTime());
258
- $this->assertIterator($this->toAbsolute(['foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
259
- }
260
-
261
- public function testSortByChangedTime()
262
- {
263
- $finder = $this->buildFinder();
264
- $this->assertSame($finder, $finder->sortByChangedTime());
265
- $this->assertIterator($this->toAbsolute(['toto', 'test.py', 'test.php', 'foo/bar.tmp', 'foo', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
266
- }
267
-
268
- public function testSortByModifiedTime()
269
- {
270
- $finder = $this->buildFinder();
271
- $this->assertSame($finder, $finder->sortByModifiedTime());
272
- $this->assertIterator($this->toAbsolute(['foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
273
- }
274
-
275
- public function testSort()
276
- {
277
- $finder = $this->buildFinder();
278
- $this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }));
279
- $this->assertIterator($this->toAbsolute(['foo', 'foo bar', 'foo/bar.tmp', 'test.php', 'test.py', 'toto']), $finder->in(self::$tmpDir)->getIterator());
280
- }
281
-
282
- public function testFilter()
283
- {
284
- $finder = $this->buildFinder();
285
- $this->assertSame($finder, $finder->filter(function (\SplFileInfo $f) { return false !== strpos($f, 'test'); }));
286
- $this->assertIterator($this->toAbsolute(['test.php', 'test.py']), $finder->in(self::$tmpDir)->getIterator());
287
- }
288
-
289
- public function testFollowLinks()
290
- {
291
- if ('\\' == \DIRECTORY_SEPARATOR) {
292
- $this->markTestSkipped('symlinks are not supported on Windows');
293
- }
294
-
295
- $finder = $this->buildFinder();
296
- $this->assertSame($finder, $finder->followLinks());
297
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar']), $finder->in(self::$tmpDir)->getIterator());
298
- }
299
-
300
- public function testIn()
301
- {
302
- $finder = $this->buildFinder();
303
- $iterator = $finder->files()->name('*.php')->depth('< 1')->in([self::$tmpDir, __DIR__])->getIterator();
304
-
305
- $expected = [
306
- self::$tmpDir.\DIRECTORY_SEPARATOR.'test.php',
307
- __DIR__.\DIRECTORY_SEPARATOR.'FinderTest.php',
308
- __DIR__.\DIRECTORY_SEPARATOR.'GlobTest.php',
309
- ];
310
-
311
- $this->assertIterator($expected, $iterator);
312
- }
313
-
314
- public function testInWithNonExistentDirectory()
315
- {
316
- $this->expectException('InvalidArgumentException');
317
- $finder = new Finder();
318
- $finder->in('foobar');
319
- }
320
-
321
- public function testInWithGlob()
322
- {
323
- $finder = $this->buildFinder();
324
- $finder->in([__DIR__.'/Fixtures/*/B/C/', __DIR__.'/Fixtures/*/*/B/C/'])->getIterator();
325
-
326
- $this->assertIterator($this->toAbsoluteFixtures(['A/B/C/abc.dat', 'copy/A/B/C/abc.dat.copy']), $finder);
327
- }
328
-
329
- public function testInWithNonDirectoryGlob()
330
- {
331
- $this->expectException('InvalidArgumentException');
332
- $finder = new Finder();
333
- $finder->in(__DIR__.'/Fixtures/A/a*');
334
- }
335
-
336
- public function testInWithGlobBrace()
337
- {
338
- if (!\defined('GLOB_BRACE')) {
339
- $this->markTestSkipped('Glob brace is not supported on this system.');
340
- }
341
-
342
- $finder = $this->buildFinder();
343
- $finder->in([__DIR__.'/Fixtures/{A,copy/A}/B/C'])->getIterator();
344
-
345
- $this->assertIterator($this->toAbsoluteFixtures(['A/B/C/abc.dat', 'copy/A/B/C/abc.dat.copy']), $finder);
346
- }
347
-
348
- public function testGetIteratorWithoutIn()
349
- {
350
- $this->expectException('LogicException');
351
- $finder = Finder::create();
352
- $finder->getIterator();
353
- }
354
-
355
- public function testGetIterator()
356
- {
357
- $finder = $this->buildFinder();
358
- $dirs = [];
359
- foreach ($finder->directories()->in(self::$tmpDir) as $dir) {
360
- $dirs[] = (string) $dir;
361
- }
362
-
363
- $expected = $this->toAbsolute(['foo', 'toto']);
364
-
365
- sort($dirs);
366
- sort($expected);
367
-
368
- $this->assertEquals($expected, $dirs, 'implements the \IteratorAggregate interface');
369
-
370
- $finder = $this->buildFinder();
371
- $this->assertEquals(2, iterator_count($finder->directories()->in(self::$tmpDir)), 'implements the \IteratorAggregate interface');
372
-
373
- $finder = $this->buildFinder();
374
- $a = iterator_to_array($finder->directories()->in(self::$tmpDir));
375
- $a = array_values(array_map('strval', $a));
376
- sort($a);
377
- $this->assertEquals($expected, $a, 'implements the \IteratorAggregate interface');
378
- }
379
-
380
- public function testRelativePath()
381
- {
382
- $finder = $this->buildFinder()->in(self::$tmpDir);
383
-
384
- $paths = [];
385
-
386
- foreach ($finder as $file) {
387
- $paths[] = $file->getRelativePath();
388
- }
389
-
390
- $ref = ['', '', '', '', 'foo', ''];
391
-
392
- sort($ref);
393
- sort($paths);
394
-
395
- $this->assertEquals($ref, $paths);
396
- }
397
-
398
- public function testRelativePathname()
399
- {
400
- $finder = $this->buildFinder()->in(self::$tmpDir)->sortByName();
401
-
402
- $paths = [];
403
-
404
- foreach ($finder as $file) {
405
- $paths[] = $file->getRelativePathname();
406
- }
407
-
408
- $ref = ['test.php', 'toto', 'test.py', 'foo', 'foo'.\DIRECTORY_SEPARATOR.'bar.tmp', 'foo bar'];
409
-
410
- sort($paths);
411
- sort($ref);
412
-
413
- $this->assertEquals($ref, $paths);
414
- }
415
-
416
- public function testAppendWithAFinder()
417
- {
418
- $finder = $this->buildFinder();
419
- $finder->files()->in(self::$tmpDir.\DIRECTORY_SEPARATOR.'foo');
420
-
421
- $finder1 = $this->buildFinder();
422
- $finder1->directories()->in(self::$tmpDir);
423
-
424
- $finder = $finder->append($finder1);
425
-
426
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'toto']), $finder->getIterator());
427
- }
428
-
429
- public function testAppendWithAnArray()
430
- {
431
- $finder = $this->buildFinder();
432
- $finder->files()->in(self::$tmpDir.\DIRECTORY_SEPARATOR.'foo');
433
-
434
- $finder->append($this->toAbsolute(['foo', 'toto']));
435
-
436
- $this->assertIterator($this->toAbsolute(['foo', 'foo/bar.tmp', 'toto']), $finder->getIterator());
437
- }
438
-
439
- public function testAppendReturnsAFinder()
440
- {
441
- $this->assertInstanceOf('Symfony\\Component\\Finder\\Finder', Finder::create()->append([]));
442
- }
443
-
444
- public function testAppendDoesNotRequireIn()
445
- {
446
- $finder = $this->buildFinder();
447
- $finder->in(self::$tmpDir.\DIRECTORY_SEPARATOR.'foo');
448
-
449
- $finder1 = Finder::create()->append($finder);
450
-
451
- $this->assertIterator(iterator_to_array($finder->getIterator()), $finder1->getIterator());
452
- }
453
-
454
- public function testCountDirectories()
455
- {
456
- $directory = Finder::create()->directories()->in(self::$tmpDir);
457
- $i = 0;
458
-
459
- foreach ($directory as $dir) {
460
- ++$i;
461
- }
462
-
463
- $this->assertCount($i, $directory);
464
- }
465
-
466
- public function testCountFiles()
467
- {
468
- $files = Finder::create()->files()->in(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures');
469
- $i = 0;
470
-
471
- foreach ($files as $file) {
472
- ++$i;
473
- }
474
-
475
- $this->assertCount($i, $files);
476
- }
477
-
478
- public function testCountWithoutIn()
479
- {
480
- $this->expectException('LogicException');
481
- $finder = Finder::create()->files();
482
- \count($finder);
483
- }
484
-
485
- public function testHasResults()
486
- {
487
- $finder = $this->buildFinder();
488
- $finder->in(__DIR__);
489
- $this->assertTrue($finder->hasResults());
490
- }
491
-
492
- public function testNoResults()
493
- {
494
- $finder = $this->buildFinder();
495
- $finder->in(__DIR__)->name('DoesNotExist');
496
- $this->assertFalse($finder->hasResults());
497
- }
498
-
499
- /**
500
- * @dataProvider getContainsTestData
501
- */
502
- public function testContains($matchPatterns, $noMatchPatterns, $expected)
503
- {
504
- $finder = $this->buildFinder();
505
- $finder->in(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures')
506
- ->name('*.txt')->sortByName()
507
- ->contains($matchPatterns)
508
- ->notContains($noMatchPatterns);
509
-
510
- $this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
511
- }
512
-
513
- public function testContainsOnDirectory()
514
- {
515
- $finder = $this->buildFinder();
516
- $finder->in(__DIR__)
517
- ->directories()
518
- ->name('Fixtures')
519
- ->contains('abc');
520
- $this->assertIterator([], $finder);
521
- }
522
-
523
- public function testNotContainsOnDirectory()
524
- {
525
- $finder = $this->buildFinder();
526
- $finder->in(__DIR__)
527
- ->directories()
528
- ->name('Fixtures')
529
- ->notContains('abc');
530
- $this->assertIterator([], $finder);
531
- }
532
-
533
- /**
534
- * Searching in multiple locations involves AppendIterator which does an unnecessary rewind which leaves FilterIterator
535
- * with inner FilesystemIterator in an invalid state.
536
- *
537
- * @see https://bugs.php.net/68557
538
- */
539
- public function testMultipleLocations()
540
- {
541
- $locations = [
542
- self::$tmpDir.'/',
543
- self::$tmpDir.'/toto/',
544
- ];
545
-
546
- // it is expected that there are test.py test.php in the tmpDir
547
- $finder = new Finder();
548
- $finder->in($locations)
549
- // the default flag IGNORE_DOT_FILES fixes the problem indirectly
550
- // so we set it to false for better isolation
551
- ->ignoreDotFiles(false)
552
- ->depth('< 1')->name('test.php');
553
-
554
- $this->assertCount(1, $finder);
555
- }
556
-
557
- /**
558
- * Searching in multiple locations with sub directories involves
559
- * AppendIterator which does an unnecessary rewind which leaves
560
- * FilterIterator with inner FilesystemIterator in an invalid state.
561
- *
562
- * @see https://bugs.php.net/68557
563
- */
564
- public function testMultipleLocationsWithSubDirectories()
565
- {
566
- $locations = [
567
- __DIR__.'/Fixtures/one',
568
- self::$tmpDir.\DIRECTORY_SEPARATOR.'toto',
569
- ];
570
-
571
- $finder = $this->buildFinder();
572
- $finder->in($locations)->depth('< 10')->name('*.neon');
573
-
574
- $expected = [
575
- __DIR__.'/Fixtures/one'.\DIRECTORY_SEPARATOR.'b'.\DIRECTORY_SEPARATOR.'c.neon',
576
- __DIR__.'/Fixtures/one'.\DIRECTORY_SEPARATOR.'b'.\DIRECTORY_SEPARATOR.'d.neon',
577
- ];
578
-
579
- $this->assertIterator($expected, $finder);
580
- $this->assertIteratorInForeach($expected, $finder);
581
- }
582
-
583
- /**
584
- * Iterator keys must be the file pathname.
585
- */
586
- public function testIteratorKeys()
587
- {
588
- $finder = $this->buildFinder()->in(self::$tmpDir);
589
- foreach ($finder as $key => $file) {
590
- $this->assertEquals($file->getPathname(), $key);
591
- }
592
- }
593
-
594
- public function testRegexSpecialCharsLocationWithPathRestrictionContainingStartFlag()
595
- {
596
- $finder = $this->buildFinder();
597
- $finder->in(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.'r+e.gex[c]a(r)s')
598
- ->path('/^dir/');
599
-
600
- $expected = ['r+e.gex[c]a(r)s'.\DIRECTORY_SEPARATOR.'dir', 'r+e.gex[c]a(r)s'.\DIRECTORY_SEPARATOR.'dir'.\DIRECTORY_SEPARATOR.'bar.dat'];
601
- $this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
602
- }
603
-
604
- public function getContainsTestData()
605
- {
606
- return [
607
- ['', '', []],
608
- ['foo', 'bar', []],
609
- ['', 'foobar', ['dolor.txt', 'ipsum.txt', 'lorem.txt']],
610
- ['lorem ipsum dolor sit amet', 'foobar', ['lorem.txt']],
611
- ['sit', 'bar', ['dolor.txt', 'ipsum.txt', 'lorem.txt']],
612
- ['dolor sit amet', '@^L@m', ['dolor.txt', 'ipsum.txt']],
613
- ['/^lorem ipsum dolor sit amet$/m', 'foobar', ['lorem.txt']],
614
- ['lorem', 'foobar', ['lorem.txt']],
615
- ['', 'lorem', ['dolor.txt', 'ipsum.txt']],
616
- ['ipsum dolor sit amet', '/^IPSUM/m', ['lorem.txt']],
617
- ];
618
- }
619
-
620
- public function getRegexNameTestData()
621
- {
622
- return [
623
- ['~.+\\.p.+~i'],
624
- ['~t.*s~i'],
625
- ];
626
- }
627
-
628
- /**
629
- * @dataProvider getTestPathData
630
- */
631
- public function testPath($matchPatterns, $noMatchPatterns, array $expected)
632
- {
633
- $finder = $this->buildFinder();
634
- $finder->in(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures')
635
- ->path($matchPatterns)
636
- ->notPath($noMatchPatterns);
637
-
638
- $this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
639
- }
640
-
641
- public function getTestPathData()
642
- {
643
- return [
644
- ['', '', []],
645
- ['/^A\/B\/C/', '/C$/',
646
- ['A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat'],
647
- ],
648
- ['/^A\/B/', 'foobar',
649
- [
650
- 'A'.\DIRECTORY_SEPARATOR.'B',
651
- 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
652
- 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
653
- 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
654
- ],
655
- ],
656
- ['A/B/C', 'foobar',
657
- [
658
- 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
659
- 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
660
- 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
661
- 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat.copy',
662
- ],
663
- ],
664
- ['A/B', 'foobar',
665
- [
666
- //dirs
667
- 'A'.\DIRECTORY_SEPARATOR.'B',
668
- 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
669
- 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B',
670
- 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
671
- //files
672
- 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
673
- 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
674
- 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat.copy',
675
- 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat.copy',
676
- ],
677
- ],
678
- ['/^with space\//', 'foobar',
679
- [
680
- 'with space'.\DIRECTORY_SEPARATOR.'foo.txt',
681
- ],
682
- ],
683
- ];
684
- }
685
-
686
- public function testAccessDeniedException()
687
- {
688
- if ('\\' === \DIRECTORY_SEPARATOR) {
689
- $this->markTestSkipped('chmod is not supported on Windows');
690
- }
691
-
692
- $finder = $this->buildFinder();
693
- $finder->files()->in(self::$tmpDir);
694
-
695
- // make 'foo' directory non-readable
696
- $testDir = self::$tmpDir.\DIRECTORY_SEPARATOR.'foo';
697
- chmod($testDir, 0333);
698
-
699
- if (false === $couldRead = is_readable($testDir)) {
700
- try {
701
- $this->assertIterator($this->toAbsolute(['foo bar', 'test.php', 'test.py']), $finder->getIterator());
702
- $this->fail('Finder should throw an exception when opening a non-readable directory.');
703
- } catch (\Exception $e) {
704
- $expectedExceptionClass = 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException';
705
- if ($e instanceof \PHPUnit\Framework\ExpectationFailedException) {
706
- $this->fail(sprintf("Expected exception:\n%s\nGot:\n%s\nWith comparison failure:\n%s", $expectedExceptionClass, 'PHPUnit\Framework\ExpectationFailedException', $e->getComparisonFailure()->getExpectedAsString()));
707
- }
708
-
709
- $this->assertInstanceOf($expectedExceptionClass, $e);
710
- }
711
- }
712
-
713
- // restore original permissions
714
- chmod($testDir, 0777);
715
- clearstatcache(true, $testDir);
716
-
717
- if ($couldRead) {
718
- $this->markTestSkipped('could read test files while test requires unreadable');
719
- }
720
- }
721
-
722
- public function testIgnoredAccessDeniedException()
723
- {
724
- if ('\\' === \DIRECTORY_SEPARATOR) {
725
- $this->markTestSkipped('chmod is not supported on Windows');
726
- }
727
-
728
- $finder = $this->buildFinder();
729
- $finder->files()->ignoreUnreadableDirs()->in(self::$tmpDir);
730
-
731
- // make 'foo' directory non-readable
732
- $testDir = self::$tmpDir.\DIRECTORY_SEPARATOR.'foo';
733
- chmod($testDir, 0333);
734
-
735
- if (false === ($couldRead = is_readable($testDir))) {
736
- $this->assertIterator($this->toAbsolute(['foo bar', 'test.php', 'test.py']), $finder->getIterator());
737
- }
738
-
739
- // restore original permissions
740
- chmod($testDir, 0777);
741
- clearstatcache(true, $testDir);
742
-
743
- if ($couldRead) {
744
- $this->markTestSkipped('could read test files while test requires unreadable');
745
- }
746
- }
747
-
748
- protected function buildFinder()
749
- {
750
- return Finder::create();
751
- }
752
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Fixtures/.dot/a DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/.dot/b/c.neon DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/.dot/b/d.neon DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/A/B/C/abc.dat DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/A/B/ab.dat DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/A/a.dat DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/copy/A/B/C/abc.dat.copy DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/copy/A/B/ab.dat.copy DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/copy/A/a.dat.copy DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/dolor.txt DELETED
@@ -1,2 +0,0 @@
1
- dolor sit amet
2
- DOLOR SIT AMET
 
 
vendor/symfony/finder/Tests/Fixtures/ipsum.txt DELETED
@@ -1,2 +0,0 @@
1
- ipsum dolor sit amet
2
- IPSUM DOLOR SIT AMET
 
 
vendor/symfony/finder/Tests/Fixtures/lorem.txt DELETED
@@ -1,2 +0,0 @@
1
- lorem ipsum dolor sit amet
2
- LOREM IPSUM DOLOR SIT AMET
 
 
vendor/symfony/finder/Tests/Fixtures/one/.dot DELETED
@@ -1 +0,0 @@
1
- .dot
 
vendor/symfony/finder/Tests/Fixtures/one/a DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/one/b/c.neon DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/one/b/d.neon DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/r+e.gex[c]a(r)s/dir/bar.dat DELETED
File without changes
vendor/symfony/finder/Tests/Fixtures/with space/foo.txt DELETED
File without changes
vendor/symfony/finder/Tests/GlobTest.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests;
13
-
14
- use PHPUnit\Framework\TestCase;
15
- use Symfony\Component\Finder\Finder;
16
- use Symfony\Component\Finder\Glob;
17
-
18
- class GlobTest extends TestCase
19
- {
20
- public function testGlobToRegexDelimiters()
21
- {
22
- $this->assertEquals('#^(?=[^\.])\#$#', Glob::toRegex('#'));
23
- $this->assertEquals('#^\.[^/]*$#', Glob::toRegex('.*'));
24
- $this->assertEquals('^\.[^/]*$', Glob::toRegex('.*', true, true, ''));
25
- $this->assertEquals('/^\.[^/]*$/', Glob::toRegex('.*', true, true, '/'));
26
- }
27
-
28
- public function testGlobToRegexDoubleStarStrictDots()
29
- {
30
- $finder = new Finder();
31
- $finder->ignoreDotFiles(false);
32
- $regex = Glob::toRegex('/**/*.neon');
33
-
34
- foreach ($finder->in(__DIR__) as $k => $v) {
35
- $k = str_replace(\DIRECTORY_SEPARATOR, '/', $k);
36
- if (preg_match($regex, substr($k, \strlen(__DIR__)))) {
37
- $match[] = substr($k, 10 + \strlen(__DIR__));
38
- }
39
- }
40
- sort($match);
41
-
42
- $this->assertSame(['one/b/c.neon', 'one/b/d.neon'], $match);
43
- }
44
-
45
- public function testGlobToRegexDoubleStarNonStrictDots()
46
- {
47
- $finder = new Finder();
48
- $finder->ignoreDotFiles(false);
49
- $regex = Glob::toRegex('/**/*.neon', false);
50
-
51
- foreach ($finder->in(__DIR__) as $k => $v) {
52
- $k = str_replace(\DIRECTORY_SEPARATOR, '/', $k);
53
- if (preg_match($regex, substr($k, \strlen(__DIR__)))) {
54
- $match[] = substr($k, 10 + \strlen(__DIR__));
55
- }
56
- }
57
- sort($match);
58
-
59
- $this->assertSame(['.dot/b/c.neon', '.dot/b/d.neon', 'one/b/c.neon', 'one/b/d.neon'], $match);
60
- }
61
-
62
- public function testGlobToRegexDoubleStarWithoutLeadingSlash()
63
- {
64
- $finder = new Finder();
65
- $finder->ignoreDotFiles(false);
66
- $regex = Glob::toRegex('/Fixtures/one/**');
67
-
68
- foreach ($finder->in(__DIR__) as $k => $v) {
69
- $k = str_replace(\DIRECTORY_SEPARATOR, '/', $k);
70
- if (preg_match($regex, substr($k, \strlen(__DIR__)))) {
71
- $match[] = substr($k, 10 + \strlen(__DIR__));
72
- }
73
- }
74
- sort($match);
75
-
76
- $this->assertSame(['one/a', 'one/b', 'one/b/c.neon', 'one/b/d.neon'], $match);
77
- }
78
-
79
- public function testGlobToRegexDoubleStarWithoutLeadingSlashNotStrictLeadingDot()
80
- {
81
- $finder = new Finder();
82
- $finder->ignoreDotFiles(false);
83
- $regex = Glob::toRegex('/Fixtures/one/**', false);
84
-
85
- foreach ($finder->in(__DIR__) as $k => $v) {
86
- $k = str_replace(\DIRECTORY_SEPARATOR, '/', $k);
87
- if (preg_match($regex, substr($k, \strlen(__DIR__)))) {
88
- $match[] = substr($k, 10 + \strlen(__DIR__));
89
- }
90
- }
91
- sort($match);
92
-
93
- $this->assertSame(['one/.dot', 'one/a', 'one/b', 'one/b/c.neon', 'one/b/d.neon'], $match);
94
- }
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/CustomFilterIteratorTest.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\CustomFilterIterator;
15
-
16
- class CustomFilterIteratorTest extends IteratorTestCase
17
- {
18
- public function testWithInvalidFilter()
19
- {
20
- $this->expectException('InvalidArgumentException');
21
- new CustomFilterIterator(new Iterator(), ['foo']);
22
- }
23
-
24
- /**
25
- * @dataProvider getAcceptData
26
- */
27
- public function testAccept($filters, $expected)
28
- {
29
- $inner = new Iterator(['test.php', 'test.py', 'foo.php']);
30
-
31
- $iterator = new CustomFilterIterator($inner, $filters);
32
-
33
- $this->assertIterator($expected, $iterator);
34
- }
35
-
36
- public function getAcceptData()
37
- {
38
- return [
39
- [[function (\SplFileInfo $fileinfo) { return false; }], []],
40
- [[function (\SplFileInfo $fileinfo) { return 0 === strpos($fileinfo, 'test'); }], ['test.php', 'test.py']],
41
- [['is_dir'], []],
42
- ];
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/DateRangeFilterIteratorTest.php DELETED
@@ -1,74 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Comparator\DateComparator;
15
- use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
16
-
17
- class DateRangeFilterIteratorTest extends RealIteratorTestCase
18
- {
19
- /**
20
- * @dataProvider getAcceptData
21
- */
22
- public function testAccept($size, $expected)
23
- {
24
- $files = self::$files;
25
- $files[] = self::toAbsolute('doesnotexist');
26
- $inner = new Iterator($files);
27
-
28
- $iterator = new DateRangeFilterIterator($inner, $size);
29
-
30
- $this->assertIterator($expected, $iterator);
31
- }
32
-
33
- public function getAcceptData()
34
- {
35
- $since20YearsAgo = [
36
- '.git',
37
- 'test.py',
38
- 'foo',
39
- 'foo/bar.tmp',
40
- 'test.php',
41
- 'toto',
42
- 'toto/.git',
43
- '.bar',
44
- '.foo',
45
- '.foo/.bar',
46
- 'foo bar',
47
- '.foo/bar',
48
- ];
49
-
50
- $since2MonthsAgo = [
51
- '.git',
52
- 'test.py',
53
- 'foo',
54
- 'toto',
55
- 'toto/.git',
56
- '.bar',
57
- '.foo',
58
- '.foo/.bar',
59
- 'foo bar',
60
- '.foo/bar',
61
- ];
62
-
63
- $untilLastMonth = [
64
- 'foo/bar.tmp',
65
- 'test.php',
66
- ];
67
-
68
- return [
69
- [[new DateComparator('since 20 years ago')], $this->toAbsolute($since20YearsAgo)],
70
- [[new DateComparator('since 2 months ago')], $this->toAbsolute($since2MonthsAgo)],
71
- [[new DateComparator('until last month')], $this->toAbsolute($untilLastMonth)],
72
- ];
73
- }
74
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/DepthRangeFilterIteratorTest.php DELETED
@@ -1,83 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
15
-
16
- class DepthRangeFilterIteratorTest extends RealIteratorTestCase
17
- {
18
- /**
19
- * @dataProvider getAcceptData
20
- */
21
- public function testAccept($minDepth, $maxDepth, $expected)
22
- {
23
- $inner = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->toAbsolute(), \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
24
-
25
- $iterator = new DepthRangeFilterIterator($inner, $minDepth, $maxDepth);
26
-
27
- $actual = array_keys(iterator_to_array($iterator));
28
- sort($expected);
29
- sort($actual);
30
- $this->assertEquals($expected, $actual);
31
- }
32
-
33
- public function getAcceptData()
34
- {
35
- $lessThan1 = [
36
- '.git',
37
- 'test.py',
38
- 'foo',
39
- 'test.php',
40
- 'toto',
41
- '.foo',
42
- '.bar',
43
- 'foo bar',
44
- ];
45
-
46
- $lessThanOrEqualTo1 = [
47
- '.git',
48
- 'test.py',
49
- 'foo',
50
- 'foo/bar.tmp',
51
- 'test.php',
52
- 'toto',
53
- 'toto/.git',
54
- '.foo',
55
- '.foo/.bar',
56
- '.bar',
57
- 'foo bar',
58
- '.foo/bar',
59
- ];
60
-
61
- $graterThanOrEqualTo1 = [
62
- 'toto/.git',
63
- 'foo/bar.tmp',
64
- '.foo/.bar',
65
- '.foo/bar',
66
- ];
67
-
68
- $equalTo1 = [
69
- 'toto/.git',
70
- 'foo/bar.tmp',
71
- '.foo/.bar',
72
- '.foo/bar',
73
- ];
74
-
75
- return [
76
- [0, 0, $this->toAbsolute($lessThan1)],
77
- [0, 1, $this->toAbsolute($lessThanOrEqualTo1)],
78
- [2, \PHP_INT_MAX, []],
79
- [1, \PHP_INT_MAX, $this->toAbsolute($graterThanOrEqualTo1)],
80
- [1, 1, $this->toAbsolute($equalTo1)],
81
- ];
82
- }
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator;
15
- use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator;
16
-
17
- class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase
18
- {
19
- /**
20
- * @dataProvider getAcceptData
21
- */
22
- public function testAccept($directories, $expected)
23
- {
24
- $inner = new \RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->toAbsolute(), \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
25
-
26
- $iterator = new ExcludeDirectoryFilterIterator($inner, $directories);
27
-
28
- $this->assertIterator($expected, $iterator);
29
- }
30
-
31
- public function getAcceptData()
32
- {
33
- $foo = [
34
- '.bar',
35
- '.foo',
36
- '.foo/.bar',
37
- '.foo/bar',
38
- '.git',
39
- 'test.py',
40
- 'test.php',
41
- 'toto',
42
- 'toto/.git',
43
- 'foo bar',
44
- ];
45
-
46
- $fo = [
47
- '.bar',
48
- '.foo',
49
- '.foo/.bar',
50
- '.foo/bar',
51
- '.git',
52
- 'test.py',
53
- 'foo',
54
- 'foo/bar.tmp',
55
- 'test.php',
56
- 'toto',
57
- 'toto/.git',
58
- 'foo bar',
59
- ];
60
-
61
- $toto = [
62
- '.bar',
63
- '.foo',
64
- '.foo/.bar',
65
- '.foo/bar',
66
- '.git',
67
- 'test.py',
68
- 'foo',
69
- 'foo/bar.tmp',
70
- 'test.php',
71
- 'foo bar',
72
- ];
73
-
74
- return [
75
- [['foo'], $this->toAbsolute($foo)],
76
- [['fo'], $this->toAbsolute($fo)],
77
- [['toto/'], $this->toAbsolute($toto)],
78
- ];
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\FileTypeFilterIterator;
15
-
16
- class FileTypeFilterIteratorTest extends RealIteratorTestCase
17
- {
18
- /**
19
- * @dataProvider getAcceptData
20
- */
21
- public function testAccept($mode, $expected)
22
- {
23
- $inner = new InnerTypeIterator(self::$files);
24
-
25
- $iterator = new FileTypeFilterIterator($inner, $mode);
26
-
27
- $this->assertIterator($expected, $iterator);
28
- }
29
-
30
- public function getAcceptData()
31
- {
32
- $onlyFiles = [
33
- 'test.py',
34
- 'foo/bar.tmp',
35
- 'test.php',
36
- '.bar',
37
- '.foo/.bar',
38
- '.foo/bar',
39
- 'foo bar',
40
- ];
41
-
42
- $onlyDirectories = [
43
- '.git',
44
- 'foo',
45
- 'toto',
46
- 'toto/.git',
47
- '.foo',
48
- ];
49
-
50
- return [
51
- [FileTypeFilterIterator::ONLY_FILES, $this->toAbsolute($onlyFiles)],
52
- [FileTypeFilterIterator::ONLY_DIRECTORIES, $this->toAbsolute($onlyDirectories)],
53
- ];
54
- }
55
- }
56
-
57
- class InnerTypeIterator extends \ArrayIterator
58
- {
59
- public function current()
60
- {
61
- return new \SplFileInfo(parent::current());
62
- }
63
-
64
- public function isFile()
65
- {
66
- return $this->current()->isFile();
67
- }
68
-
69
- public function isDir()
70
- {
71
- return $this->current()->isDir();
72
- }
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/FilecontentFilterIteratorTest.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
15
-
16
- class FilecontentFilterIteratorTest extends IteratorTestCase
17
- {
18
- public function testAccept()
19
- {
20
- $inner = new MockFileListIterator(['test.txt']);
21
- $iterator = new FilecontentFilterIterator($inner, [], []);
22
- $this->assertIterator(['test.txt'], $iterator);
23
- }
24
-
25
- public function testDirectory()
26
- {
27
- $inner = new MockFileListIterator(['directory']);
28
- $iterator = new FilecontentFilterIterator($inner, ['directory'], []);
29
- $this->assertIterator([], $iterator);
30
- }
31
-
32
- public function testUnreadableFile()
33
- {
34
- $inner = new MockFileListIterator(['file r-']);
35
- $iterator = new FilecontentFilterIterator($inner, ['file r-'], []);
36
- $this->assertIterator([], $iterator);
37
- }
38
-
39
- /**
40
- * @dataProvider getTestFilterData
41
- */
42
- public function testFilter(\Iterator $inner, array $matchPatterns, array $noMatchPatterns, array $resultArray)
43
- {
44
- $iterator = new FilecontentFilterIterator($inner, $matchPatterns, $noMatchPatterns);
45
- $this->assertIterator($resultArray, $iterator);
46
- }
47
-
48
- public function getTestFilterData()
49
- {
50
- $inner = new MockFileListIterator();
51
-
52
- $inner[] = new MockSplFileInfo([
53
- 'name' => 'a.txt',
54
- 'contents' => 'Lorem ipsum...',
55
- 'type' => 'file',
56
- 'mode' => 'r+', ]
57
- );
58
-
59
- $inner[] = new MockSplFileInfo([
60
- 'name' => 'b.yml',
61
- 'contents' => 'dolor sit...',
62
- 'type' => 'file',
63
- 'mode' => 'r+', ]
64
- );
65
-
66
- $inner[] = new MockSplFileInfo([
67
- 'name' => 'some/other/dir/third.php',
68
- 'contents' => 'amet...',
69
- 'type' => 'file',
70
- 'mode' => 'r+', ]
71
- );
72
-
73
- $inner[] = new MockSplFileInfo([
74
- 'name' => 'unreadable-file.txt',
75
- 'contents' => false,
76
- 'type' => 'file',
77
- 'mode' => 'r+', ]
78
- );
79
-
80
- return [
81
- [$inner, ['.'], [], ['a.txt', 'b.yml', 'some/other/dir/third.php']],
82
- [$inner, ['ipsum'], [], ['a.txt']],
83
- [$inner, ['i', 'amet'], ['Lorem', 'amet'], ['b.yml']],
84
- ];
85
- }
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/FilenameFilterIteratorTest.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
15
-
16
- class FilenameFilterIteratorTest extends IteratorTestCase
17
- {
18
- /**
19
- * @dataProvider getAcceptData
20
- */
21
- public function testAccept($matchPatterns, $noMatchPatterns, $expected)
22
- {
23
- $inner = new InnerNameIterator(['test.php', 'test.py', 'foo.php']);
24
-
25
- $iterator = new FilenameFilterIterator($inner, $matchPatterns, $noMatchPatterns);
26
-
27
- $this->assertIterator($expected, $iterator);
28
- }
29
-
30
- public function getAcceptData()
31
- {
32
- return [
33
- [['test.*'], [], ['test.php', 'test.py']],
34
- [[], ['test.*'], ['foo.php']],
35
- [['*.php'], ['test.*'], ['foo.php']],
36
- [['*.php', '*.py'], ['foo.*'], ['test.php', 'test.py']],
37
- [['/\.php$/'], [], ['test.php', 'foo.php']],
38
- [[], ['/\.php$/'], ['test.py']],
39
- ];
40
- }
41
- }
42
-
43
- class InnerNameIterator extends \ArrayIterator
44
- {
45
- public function current()
46
- {
47
- return new \SplFileInfo(parent::current());
48
- }
49
-
50
- public function getFilename()
51
- {
52
- return parent::current();
53
- }
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- /**
15
- * @author Alex Bogomazov
16
- *
17
- * @group legacy
18
- */
19
- class FilterIteratorTest extends RealIteratorTestCase
20
- {
21
- public function testFilterFilesystemIterators()
22
- {
23
- $i = new \FilesystemIterator($this->toAbsolute());
24
-
25
- // it is expected that there are test.py test.php in the tmpDir
26
- $i = $this->getMockForAbstractClass('Symfony\Component\Finder\Iterator\FilterIterator', [$i]);
27
- $i->expects($this->any())
28
- ->method('accept')
29
- ->willReturnCallback(function () use ($i) {
30
- return (bool) preg_match('/\.php/', (string) $i->current());
31
- }
32
- );
33
-
34
- $c = 0;
35
- foreach ($i as $item) {
36
- ++$c;
37
- }
38
-
39
- $this->assertEquals(1, $c);
40
-
41
- $i->rewind();
42
-
43
- $c = 0;
44
- foreach ($i as $item) {
45
- ++$c;
46
- }
47
-
48
- // This would fail in php older than 5.5.23/5.6.7 with \FilterIterator
49
- // but works with Symfony\Component\Finder\Iterator\FilterIterator
50
- // see https://bugs.php.net/68557
51
- $this->assertEquals(1, $c);
52
- }
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/Iterator.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- class Iterator implements \Iterator
15
- {
16
- protected $values = [];
17
-
18
- public function __construct(array $values = [])
19
- {
20
- foreach ($values as $value) {
21
- $this->attach(new \SplFileInfo($value));
22
- }
23
- $this->rewind();
24
- }
25
-
26
- public function attach(\SplFileInfo $fileinfo)
27
- {
28
- $this->values[] = $fileinfo;
29
- }
30
-
31
- public function rewind()
32
- {
33
- reset($this->values);
34
- }
35
-
36
- public function valid()
37
- {
38
- return false !== $this->current();
39
- }
40
-
41
- public function next()
42
- {
43
- next($this->values);
44
- }
45
-
46
- public function current()
47
- {
48
- return current($this->values);
49
- }
50
-
51
- public function key()
52
- {
53
- return key($this->values);
54
- }
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/IteratorTestCase.php DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use PHPUnit\Framework\TestCase;
15
-
16
- abstract class IteratorTestCase extends TestCase
17
- {
18
- protected function assertIterator($expected, \Traversable $iterator)
19
- {
20
- // set iterator_to_array $use_key to false to avoid values merge
21
- // this made FinderTest::testAppendWithAnArray() fail with GnuFinderAdapter
22
- $values = array_map(function (\SplFileInfo $fileinfo) { return str_replace('/', \DIRECTORY_SEPARATOR, $fileinfo->getPathname()); }, iterator_to_array($iterator, false));
23
-
24
- $expected = array_map(function ($path) { return str_replace('/', \DIRECTORY_SEPARATOR, $path); }, $expected);
25
-
26
- sort($values);
27
- sort($expected);
28
-
29
- $this->assertEquals($expected, array_values($values));
30
- }
31
-
32
- protected function assertOrderedIterator($expected, \Traversable $iterator)
33
- {
34
- $values = array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator));
35
-
36
- $this->assertEquals($expected, array_values($values));
37
- }
38
-
39
- /**
40
- * Same as assertOrderedIterator, but checks the order of groups of
41
- * array elements.
42
- *
43
- * @param array $expected - an array of arrays. For any two subarrays
44
- * $a and $b such that $a goes before $b in $expected, the method
45
- * asserts that any element of $a goes before any element of $b
46
- * in the sequence generated by $iterator
47
- */
48
- protected function assertOrderedIteratorForGroups(array $expected, \Traversable $iterator)
49
- {
50
- $values = array_values(array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator)));
51
-
52
- foreach ($expected as $subarray) {
53
- $temp = [];
54
- while (\count($values) && \count($temp) < \count($subarray)) {
55
- $temp[] = array_shift($values);
56
- }
57
- sort($temp);
58
- sort($subarray);
59
- $this->assertEquals($subarray, $temp);
60
- }
61
- }
62
-
63
- /**
64
- * Same as IteratorTestCase::assertIterator with foreach usage.
65
- */
66
- protected function assertIteratorInForeach(array $expected, \Traversable $iterator)
67
- {
68
- $values = [];
69
- foreach ($iterator as $file) {
70
- $this->assertInstanceOf('Symfony\\Component\\Finder\\SplFileInfo', $file);
71
- $values[] = $file->getPathname();
72
- }
73
-
74
- sort($values);
75
- sort($expected);
76
-
77
- $this->assertEquals($expected, array_values($values));
78
- }
79
-
80
- /**
81
- * Same as IteratorTestCase::assertOrderedIterator with foreach usage.
82
- */
83
- protected function assertOrderedIteratorInForeach(array $expected, \Traversable $iterator)
84
- {
85
- $values = [];
86
- foreach ($iterator as $file) {
87
- $this->assertInstanceOf('Symfony\\Component\\Finder\\SplFileInfo', $file);
88
- $values[] = $file->getPathname();
89
- }
90
-
91
- $this->assertEquals($expected, array_values($values));
92
- }
93
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/MockFileListIterator.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- class MockFileListIterator extends \ArrayIterator
15
- {
16
- public function __construct(array $filesArray = [])
17
- {
18
- $files = array_map(function ($file) { return new MockSplFileInfo($file); }, $filesArray);
19
- parent::__construct($files);
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/MockSplFileInfo.php DELETED
@@ -1,132 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- class MockSplFileInfo extends \SplFileInfo
15
- {
16
- const TYPE_DIRECTORY = 1;
17
- const TYPE_FILE = 2;
18
- const TYPE_UNKNOWN = 3;
19
-
20
- private $contents = null;
21
- private $mode = null;
22
- private $type = null;
23
- private $relativePath = null;
24
- private $relativePathname = null;
25
-
26
- public function __construct($param)
27
- {
28
- if (\is_string($param)) {
29
- parent::__construct($param);
30
- } elseif (\is_array($param)) {
31
- $defaults = [
32
- 'name' => 'file.txt',
33
- 'contents' => null,
34
- 'mode' => null,
35
- 'type' => null,
36
- 'relativePath' => null,
37
- 'relativePathname' => null,
38
- ];
39
- $defaults = array_merge($defaults, $param);
40
- parent::__construct($defaults['name']);
41
- $this->setContents($defaults['contents']);
42
- $this->setMode($defaults['mode']);
43
- $this->setType($defaults['type']);
44
- $this->setRelativePath($defaults['relativePath']);
45
- $this->setRelativePathname($defaults['relativePathname']);
46
- } else {
47
- throw new \RuntimeException(sprintf('Incorrect parameter "%s"', $param));
48
- }
49
- }
50
-
51
- public function isFile()
52
- {
53
- if (null === $this->type) {
54
- return false !== strpos($this->getFilename(), 'file');
55
- }
56
-
57
- return self::TYPE_FILE === $this->type;
58
- }
59
-
60
- public function isDir()
61
- {
62
- if (null === $this->type) {
63
- return false !== strpos($this->getFilename(), 'directory');
64
- }
65
-
66
- return self::TYPE_DIRECTORY === $this->type;
67
- }
68
-
69
- public function isReadable()
70
- {
71
- if (null === $this->mode) {
72
- return preg_match('/r\+/', $this->getFilename());
73
- }
74
-
75
- return preg_match('/r\+/', $this->mode);
76
- }
77
-
78
- public function getContents()
79
- {
80
- return $this->contents;
81
- }
82
-
83
- public function setContents($contents)
84
- {
85
- $this->contents = $contents;
86
- }
87
-
88
- public function setMode($mode)
89
- {
90
- $this->mode = $mode;
91
- }
92
-
93
- public function setType($type)
94
- {
95
- if (\is_string($type)) {
96
- switch ($type) {
97
- case 'directory':
98
- case 'd':
99
- $this->type = self::TYPE_DIRECTORY;
100
- break;
101
- case 'file':
102
- case 'f':
103
- $this->type = self::TYPE_FILE;
104
- break;
105
- default:
106
- $this->type = self::TYPE_UNKNOWN;
107
- }
108
- } else {
109
- $this->type = $type;
110
- }
111
- }
112
-
113
- public function setRelativePath($relativePath)
114
- {
115
- $this->relativePath = $relativePath;
116
- }
117
-
118
- public function setRelativePathname($relativePathname)
119
- {
120
- $this->relativePathname = $relativePathname;
121
- }
122
-
123
- public function getRelativePath()
124
- {
125
- return $this->relativePath;
126
- }
127
-
128
- public function getRelativePathname()
129
- {
130
- return $this->relativePathname;
131
- }
132
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/MultiplePcreFilterIteratorTest.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use PHPUnit\Framework\TestCase;
15
- use Symfony\Component\Finder\Iterator\MultiplePcreFilterIterator;
16
-
17
- class MultiplePcreFilterIteratorTest extends TestCase
18
- {
19
- /**
20
- * @dataProvider getIsRegexFixtures
21
- */
22
- public function testIsRegex($string, $isRegex, $message)
23
- {
24
- $testIterator = new TestMultiplePcreFilterIterator();
25
- $this->assertEquals($isRegex, $testIterator->isRegex($string), $message);
26
- }
27
-
28
- public function getIsRegexFixtures()
29
- {
30
- return [
31
- ['foo', false, 'string'],
32
- [' foo ', false, '" " is not a valid delimiter'],
33
- ['\\foo\\', false, '"\\" is not a valid delimiter'],
34
- ['afooa', false, '"a" is not a valid delimiter'],
35
- ['//', false, 'the pattern should contain at least 1 character'],
36
- ['/a/', true, 'valid regex'],
37
- ['/foo/', true, 'valid regex'],
38
- ['/foo/i', true, 'valid regex with a single modifier'],
39
- ['/foo/imsxu', true, 'valid regex with multiple modifiers'],
40
- ['#foo#', true, '"#" is a valid delimiter'],
41
- ['{foo}', true, '"{,}" is a valid delimiter pair'],
42
- ['[foo]', true, '"[,]" is a valid delimiter pair'],
43
- ['(foo)', true, '"(,)" is a valid delimiter pair'],
44
- ['<foo>', true, '"<,>" is a valid delimiter pair'],
45
- ['*foo.*', false, '"*" is not considered as a valid delimiter'],
46
- ['?foo.?', false, '"?" is not considered as a valid delimiter'],
47
- ];
48
- }
49
- }
50
-
51
- class TestMultiplePcreFilterIterator extends MultiplePcreFilterIterator
52
- {
53
- public function __construct()
54
- {
55
- }
56
-
57
- public function accept()
58
- {
59
- throw new \BadFunctionCallException('Not implemented');
60
- }
61
-
62
- public function isRegex($str)
63
- {
64
- return parent::isRegex($str);
65
- }
66
-
67
- public function toRegex($str)
68
- {
69
- throw new \BadFunctionCallException('Not implemented');
70
- }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/PathFilterIteratorTest.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\PathFilterIterator;
15
-
16
- class PathFilterIteratorTest extends IteratorTestCase
17
- {
18
- /**
19
- * @dataProvider getTestFilterData
20
- */
21
- public function testFilter(\Iterator $inner, array $matchPatterns, array $noMatchPatterns, array $resultArray)
22
- {
23
- $iterator = new PathFilterIterator($inner, $matchPatterns, $noMatchPatterns);
24
- $this->assertIterator($resultArray, $iterator);
25
- }
26
-
27
- public function getTestFilterData()
28
- {
29
- $inner = new MockFileListIterator();
30
-
31
- //PATH: A/B/C/abc.dat
32
- $inner[] = new MockSplFileInfo([
33
- 'name' => 'abc.dat',
34
- 'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
35
- ]);
36
-
37
- //PATH: A/B/ab.dat
38
- $inner[] = new MockSplFileInfo([
39
- 'name' => 'ab.dat',
40
- 'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
41
- ]);
42
-
43
- //PATH: A/a.dat
44
- $inner[] = new MockSplFileInfo([
45
- 'name' => 'a.dat',
46
- 'relativePathname' => 'A'.\DIRECTORY_SEPARATOR.'a.dat',
47
- ]);
48
-
49
- //PATH: copy/A/B/C/abc.dat.copy
50
- $inner[] = new MockSplFileInfo([
51
- 'name' => 'abc.dat.copy',
52
- 'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
53
- ]);
54
-
55
- //PATH: copy/A/B/ab.dat.copy
56
- $inner[] = new MockSplFileInfo([
57
- 'name' => 'ab.dat.copy',
58
- 'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
59
- ]);
60
-
61
- //PATH: copy/A/a.dat.copy
62
- $inner[] = new MockSplFileInfo([
63
- 'name' => 'a.dat.copy',
64
- 'relativePathname' => 'copy'.\DIRECTORY_SEPARATOR.'A'.\DIRECTORY_SEPARATOR.'a.dat',
65
- ]);
66
-
67
- return [
68
- [$inner, ['/^A/'], [], ['abc.dat', 'ab.dat', 'a.dat']],
69
- [$inner, ['/^A\/B/'], [], ['abc.dat', 'ab.dat']],
70
- [$inner, ['/^A\/B\/C/'], [], ['abc.dat']],
71
- [$inner, ['/A\/B\/C/'], [], ['abc.dat', 'abc.dat.copy']],
72
-
73
- [$inner, ['A'], [], ['abc.dat', 'ab.dat', 'a.dat', 'abc.dat.copy', 'ab.dat.copy', 'a.dat.copy']],
74
- [$inner, ['A/B'], [], ['abc.dat', 'ab.dat', 'abc.dat.copy', 'ab.dat.copy']],
75
- [$inner, ['A/B/C'], [], ['abc.dat', 'abc.dat.copy']],
76
-
77
- [$inner, ['copy/A'], [], ['abc.dat.copy', 'ab.dat.copy', 'a.dat.copy']],
78
- [$inner, ['copy/A/B'], [], ['abc.dat.copy', 'ab.dat.copy']],
79
- [$inner, ['copy/A/B/C'], [], ['abc.dat.copy']],
80
- ];
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/RealIteratorTestCase.php DELETED
@@ -1,119 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- abstract class RealIteratorTestCase extends IteratorTestCase
15
- {
16
- protected static $tmpDir;
17
- protected static $files;
18
-
19
- public static function setUpBeforeClass()
20
- {
21
- self::$tmpDir = realpath(sys_get_temp_dir()).\DIRECTORY_SEPARATOR.'symfony_finder';
22
-
23
- self::$files = [
24
- '.git/',
25
- '.foo/',
26
- '.foo/.bar',
27
- '.foo/bar',
28
- '.bar',
29
- 'test.py',
30
- 'foo/',
31
- 'foo/bar.tmp',
32
- 'test.php',
33
- 'toto/',
34
- 'toto/.git/',
35
- 'foo bar',
36
- ];
37
-
38
- self::$files = self::toAbsolute(self::$files);
39
-
40
- if (is_dir(self::$tmpDir)) {
41
- self::tearDownAfterClass();
42
- } else {
43
- mkdir(self::$tmpDir);
44
- }
45
-
46
- foreach (self::$files as $file) {
47
- if (\DIRECTORY_SEPARATOR === $file[\strlen($file) - 1]) {
48
- mkdir($file);
49
- } else {
50
- touch($file);
51
- }
52
- }
53
-
54
- file_put_contents(self::toAbsolute('test.php'), str_repeat(' ', 800));
55
- file_put_contents(self::toAbsolute('test.py'), str_repeat(' ', 2000));
56
-
57
- touch(self::toAbsolute('foo/bar.tmp'), strtotime('2005-10-15'));
58
- touch(self::toAbsolute('test.php'), strtotime('2005-10-15'));
59
- }
60
-
61
- public static function tearDownAfterClass()
62
- {
63
- $paths = new \RecursiveIteratorIterator(
64
- new \RecursiveDirectoryIterator(self::$tmpDir, \RecursiveDirectoryIterator::SKIP_DOTS),
65
- \RecursiveIteratorIterator::CHILD_FIRST
66
- );
67
-
68
- foreach ($paths as $path) {
69
- if ($path->isDir()) {
70
- if ($path->isLink()) {
71
- @unlink($path);
72
- } else {
73
- @rmdir($path);
74
- }
75
- } else {
76
- @unlink($path);
77
- }
78
- }
79
- }
80
-
81
- protected static function toAbsolute($files = null)
82
- {
83
- /*
84
- * Without the call to setUpBeforeClass() property can be null.
85
- */
86
- if (!self::$tmpDir) {
87
- self::$tmpDir = realpath(sys_get_temp_dir()).\DIRECTORY_SEPARATOR.'symfony_finder';
88
- }
89
-
90
- if (\is_array($files)) {
91
- $f = [];
92
- foreach ($files as $file) {
93
- if (\is_array($file)) {
94
- $f[] = self::toAbsolute($file);
95
- } else {
96
- $f[] = self::$tmpDir.\DIRECTORY_SEPARATOR.str_replace('/', \DIRECTORY_SEPARATOR, $file);
97
- }
98
- }
99
-
100
- return $f;
101
- }
102
-
103
- if (\is_string($files)) {
104
- return self::$tmpDir.\DIRECTORY_SEPARATOR.str_replace('/', \DIRECTORY_SEPARATOR, $files);
105
- }
106
-
107
- return self::$tmpDir;
108
- }
109
-
110
- protected static function toAbsoluteFixtures($files)
111
- {
112
- $f = [];
113
- foreach ($files as $file) {
114
- $f[] = realpath(__DIR__.\DIRECTORY_SEPARATOR.'..'.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.$file);
115
- }
116
-
117
- return $f;
118
- }
119
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator;
15
-
16
- class RecursiveDirectoryIteratorTest extends IteratorTestCase
17
- {
18
- /**
19
- * @group network
20
- */
21
- public function testRewindOnFtp()
22
- {
23
- try {
24
- $i = new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
25
- } catch (\UnexpectedValueException $e) {
26
- $this->markTestSkipped('Unsupported stream "ftp".');
27
- }
28
-
29
- $i->rewind();
30
-
31
- $this->assertTrue(true);
32
- }
33
-
34
- /**
35
- * @group network
36
- */
37
- public function testSeekOnFtp()
38
- {
39
- try {
40
- $i = new RecursiveDirectoryIterator('ftp://speedtest.tele2.net/', \RecursiveDirectoryIterator::SKIP_DOTS);
41
- } catch (\UnexpectedValueException $e) {
42
- $this->markTestSkipped('Unsupported stream "ftp".');
43
- }
44
-
45
- $contains = [
46
- 'ftp://speedtest.tele2.net'.\DIRECTORY_SEPARATOR.'1000GB.zip',
47
- 'ftp://speedtest.tele2.net'.\DIRECTORY_SEPARATOR.'100GB.zip',
48
- ];
49
- $actual = [];
50
-
51
- $i->seek(0);
52
- $actual[] = $i->getPathname();
53
-
54
- $i->seek(1);
55
- $actual[] = $i->getPathname();
56
-
57
- $this->assertEquals($contains, $actual);
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/SizeRangeFilterIteratorTest.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Comparator\NumberComparator;
15
- use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
16
-
17
- class SizeRangeFilterIteratorTest extends RealIteratorTestCase
18
- {
19
- /**
20
- * @dataProvider getAcceptData
21
- */
22
- public function testAccept($size, $expected)
23
- {
24
- $inner = new InnerSizeIterator(self::$files);
25
-
26
- $iterator = new SizeRangeFilterIterator($inner, $size);
27
-
28
- $this->assertIterator($expected, $iterator);
29
- }
30
-
31
- public function getAcceptData()
32
- {
33
- $lessThan1KGreaterThan05K = [
34
- '.foo',
35
- '.git',
36
- 'foo',
37
- 'test.php',
38
- 'toto',
39
- 'toto/.git',
40
- ];
41
-
42
- return [
43
- [[new NumberComparator('< 1K'), new NumberComparator('> 0.5K')], $this->toAbsolute($lessThan1KGreaterThan05K)],
44
- ];
45
- }
46
- }
47
-
48
- class InnerSizeIterator extends \ArrayIterator
49
- {
50
- public function current()
51
- {
52
- return new \SplFileInfo(parent::current());
53
- }
54
-
55
- public function getFilename()
56
- {
57
- return parent::current();
58
- }
59
-
60
- public function isFile()
61
- {
62
- return $this->current()->isFile();
63
- }
64
-
65
- public function getSize()
66
- {
67
- return $this->current()->getSize();
68
- }
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/Tests/Iterator/SortableIteratorTest.php DELETED
@@ -1,179 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Component\Finder\Tests\Iterator;
13
-
14
- use Symfony\Component\Finder\Iterator\SortableIterator;
15
-
16
- class SortableIteratorTest extends RealIteratorTestCase
17
- {
18
- public function testConstructor()
19
- {
20
- try {
21
- new SortableIterator(new Iterator([]), 'foobar');
22
- $this->fail('__construct() throws an \InvalidArgumentException exception if the mode is not valid');
23
- } catch (\Exception $e) {
24
- $this->assertInstanceOf('InvalidArgumentException', $e, '__construct() throws an \InvalidArgumentException exception if the mode is not valid');
25
- }
26
- }
27
-
28
- /**
29
- * @dataProvider getAcceptData
30
- */
31
- public function testAccept($mode, $expected)
32
- {
33
- if (!\is_callable($mode)) {
34
- switch ($mode) {
35
- case SortableIterator::SORT_BY_ACCESSED_TIME:
36
- touch(self::toAbsolute('.git'));
37
- sleep(1);
38
- file_get_contents(self::toAbsolute('.bar'));
39
- break;
40
- case SortableIterator::SORT_BY_CHANGED_TIME:
41
- file_put_contents(self::toAbsolute('test.php'), 'foo');
42
- sleep(1);
43
- file_put_contents(self::toAbsolute('test.py'), 'foo');
44
- break;
45
- case SortableIterator::SORT_BY_MODIFIED_TIME:
46
- file_put_contents(self::toAbsolute('test.php'), 'foo');
47
- sleep(1);
48
- file_put_contents(self::toAbsolute('test.py'), 'foo');
49
- break;
50
- }
51
- }
52
-
53
- $inner = new Iterator(self::$files);
54
-
55
- $iterator = new SortableIterator($inner, $mode);
56
-
57
- if (SortableIterator::SORT_BY_ACCESSED_TIME === $mode
58
- || SortableIterator::SORT_BY_CHANGED_TIME === $mode
59
- || SortableIterator::SORT_BY_MODIFIED_TIME === $mode
60
- ) {
61
- if ('\\' === \DIRECTORY_SEPARATOR && SortableIterator::SORT_BY_MODIFIED_TIME !== $mode) {
62
- $this->markTestSkipped('Sorting by atime or ctime is not supported on Windows');
63
- }
64
- $this->assertOrderedIteratorForGroups($expected, $iterator);
65
- } else {
66
- $this->assertOrderedIterator($expected, $iterator);
67
- }
68
- }
69
-
70
- public function getAcceptData()
71
- {
72
- $sortByName = [
73
- '.bar',
74
- '.foo',
75
- '.foo/.bar',
76
- '.foo/bar',
77
- '.git',
78
- 'foo',
79
- 'foo bar',
80
- 'foo/bar.tmp',
81
- 'test.php',
82
- 'test.py',
83
- 'toto',
84
- 'toto/.git',
85
- ];
86
-
87
- $sortByType = [
88
- '.foo',
89
- '.git',
90
- 'foo',
91
- 'toto',
92
- 'toto/.git',
93
- '.bar',
94
- '.foo/.bar',
95
- '.foo/bar',
96
- 'foo bar',
97
- 'foo/bar.tmp',
98
- 'test.php',
99
- 'test.py',
100
- ];
101
-
102
- $customComparison = [
103
- '.bar',
104
- '.foo',
105
- '.foo/.bar',
106
- '.foo/bar',
107
- '.git',
108
- 'foo',
109
- 'foo bar',
110
- 'foo/bar.tmp',
111
- 'test.php',
112
- 'test.py',
113
- 'toto',
114
- 'toto/.git',
115
- ];
116
-
117
- $sortByAccessedTime = [
118
- // For these two files the access time was set to 2005-10-15
119
- ['foo/bar.tmp', 'test.php'],
120
- // These files were created more or less at the same time
121
- [
122
- '.git',
123
- '.foo',
124
- '.foo/.bar',
125
- '.foo/bar',
126
- 'test.py',
127
- 'foo',
128
- 'toto',
129
- 'toto/.git',
130
- 'foo bar',
131
- ],
132
- // This file was accessed after sleeping for 1 sec
133
- ['.bar'],
134
- ];
135
-
136
- $sortByChangedTime = [
137
- [
138
- '.git',
139
- '.foo',
140
- '.foo/.bar',
141
- '.foo/bar',
142
- '.bar',
143
- 'foo',
144
- 'foo/bar.tmp',
145
- 'toto',
146
- 'toto/.git',
147
- 'foo bar',
148
- ],
149
- ['test.php'],
150
- ['test.py'],
151
- ];
152
-
153
- $sortByModifiedTime = [
154
- [
155
- '.git',
156
- '.foo',
157
- '.foo/.bar',
158
- '.foo/bar',
159
- '.bar',
160
- 'foo',
161
- 'foo/bar.tmp',
162
- 'toto',
163
- 'toto/.git',
164
- 'foo bar',
165
- ],
166
- ['test.php'],
167
- ['test.py'],
168
- ];
169
-
170
- return [
171
- [SortableIterator::SORT_BY_NAME, $this->toAbsolute($sortByName)],
172
- [SortableIterator::SORT_BY_TYPE, $this->toAbsolute($sortByType)],
173
- [SortableIterator::SORT_BY_ACCESSED_TIME, $this->toAbsolute($sortByAccessedTime)],
174
- [SortableIterator::SORT_BY_CHANGED_TIME, $this->toAbsolute($sortByChangedTime)],
175
- [SortableIterator::SORT_BY_MODIFIED_TIME, $this->toAbsolute($sortByModifiedTime)],
176
- [function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }, $this->toAbsolute($customComparison)],
177
- ];
178
- }
179
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/symfony/finder/composer.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "name": "symfony/finder",
3
  "type": "library",
4
- "description": "Symfony Finder Component",
5
  "keywords": [],
6
  "homepage": "https://symfony.com",
7
  "license": "MIT",
@@ -16,7 +16,7 @@
16
  }
17
  ],
18
  "require": {
19
- "php": "^5.5.9|>=7.0.8"
20
  },
21
  "autoload": {
22
  "psr-4": { "Symfony\\Component\\Finder\\": "" },
1
  {
2
  "name": "symfony/finder",
3
  "type": "library",
4
+ "description": "Finds files and directories via an intuitive fluent interface",
5
  "keywords": [],
6
  "homepage": "https://symfony.com",
7
  "license": "MIT",
16
  }
17
  ],
18
  "require": {
19
+ "php": ">=7.2.5"
20
  },
21
  "autoload": {
22
  "psr-4": { "Symfony\\Component\\Finder\\": "" },
vendor/symfony/finder/phpunit.xml.dist DELETED
@@ -1,30 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
- xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
5
- backupGlobals="false"
6
- colors="true"
7
- bootstrap="vendor/autoload.php"
8
- failOnRisky="true"
9
- failOnWarning="true"
10
- >
11
- <php>
12
- <ini name="error_reporting" value="-1" />
13
- </php>
14
-
15
- <testsuites>
16
- <testsuite name="Symfony Finder Component Test Suite">
17
- <directory>./Tests/</directory>
18
- </testsuite>
19
- </testsuites>
20
-
21
- <filter>
22
- <whitelist>
23
- <directory>./</directory>
24
- <exclude>
25
- <directory>./Tests</directory>
26
- <directory>./vendor</directory>
27
- </exclude>
28
- </whitelist>
29
- </filter>
30
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/voku/portable-ascii/CHANGELOG.md ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+
3
+ ### 1.5.6 (2020-11-12)
4
+
5
+ - "ASCII::normalize_whitespace()" -> can now also remove "control characters" if needed v2
6
+
7
+ ### 1.5.5 (2020-11-12)
8
+
9
+ - fix "Greeklish" char-mapping (thanks @sebdesign)
10
+ - "ASCII::normalize_whitespace()" -> can now also remove "control characters" if needed
11
+
12
+ ### 1.5.4 (2020-11-08)
13
+
14
+ - add some missing replacements in U+23xx page (thanks @marcoffee)
15
+ - fix "Russian" char-mapping (thanks @ilyahoilik)
16
+ - running test with PHP 8.0 rc3
17
+
18
+ ### 1.5.3 (2020-07-23)
19
+
20
+ - fix "Georgian" char-mapping (thanks @waska14)
21
+
22
+ ### 1.5.2 (2020-06-16)
23
+
24
+ - add "Bengali" (bn) language support (thanks @eliyas5044)
25
+ - fix "Portuguese" char-mapping
26
+ - reduce the file size (removed extra comments from "avian2/unidecode")
27
+
28
+ ### 1.5.1 (2020-05-26)
29
+
30
+ - fix merge ASCII transliterations from "avian2/unidecode" (python)
31
+ -> https://github.com/avian2/unidecode/
32
+
33
+ ### 1.5.0 (2020-05-24)
34
+
35
+ - merge ASCII transliterations from "avian2/unidecode" (python)
36
+ -> https://github.com/avian2/unidecode/
37
+
38
+ ### 1.4.11 (2020-05-23)
39
+
40
+ - "composer.json" -> remove "autoload-dev" stuff from "autoload"
41
+ - "voku/php-readme-helper" -> auto-generate the API documentation in the README
42
+
43
+ ### 1.4.10 (2020-03-13)
44
+
45
+ - ASCII::to_ascii() -> fix extra symbol handling in the regex
46
+ - ASCII::to_ascii() -> fix for languages with multi-length-special-char (e.g. Greek -> 'ει' => 'i')
47
+
48
+ ### 1.4.9 (2020-03-06)
49
+
50
+ - ASCII::to_slugify() -> fix php warning from empty "separator"
51
+
52
+ ### 1.4.8 (2020-02-06)
53
+
54
+ - small optimization for "ASCII::to_ascii()" performance
55
+
56
+ ### 1.4.7 (2020-01-27)
57
+
58
+ - fix possible wrong type from "getDataIfExists()" -> e.g. a bug reported where "/data/" was modified
59
+ - inline variables
60
+ - do not use "=== true" for "bool"-types
61
+
62
+ ### 1.4.6 (2019-12-23)
63
+
64
+ - optimize "ASCII::to_ascii()" performance
65
+ - add "armenian" chars
66
+ - add "ASCII:getAllLanguages()"
67
+
68
+ ### 1.4.5 (2019-12-19)
69
+
70
+ - use "@psalm-pure" v2
71
+
72
+ ### 1.4.4 (2019-12-19)
73
+
74
+ - use "@psalm-pure"
75
+
76
+ ### 1.4.3 (2019-12-19)
77
+
78
+ - use "@psalm-immutable"
79
+
80
+ ### 1.4.2 (2019-12-13)
81
+
82
+ - optimize the performance v2
83
+ - more fixes for non-ascii regex
84
+
85
+ ### 1.4.1 (2019-12-13)
86
+
87
+ - fix regex for non-ascii
88
+
89
+ ### 1.4.0 (2019-12-13)
90
+
91
+ - optimize the performance, via single char replacements
92
+
93
+ ### 1.3.6 (2019-12-13)
94
+
95
+ - "ascii_extras" -> convert the static content into ascii
96
+ -> e.g.: instead of replacing "+" with "più" we use "piu" (Italian), because we want to use ascii anyway
97
+
98
+ ### 1.3.5 (2019-11-11)
99
+
100
+ - fix "ASCII::remove_invisible_characters()" -> do not remove invisible encoded url strings by default
101
+
102
+ ### 1.3.4 (2019-10-14)
103
+
104
+ - fix static cache for "ASCII::charsArrayWithOneLanguage"
105
+
106
+ ### 1.3.3 (2019-10-14)
107
+
108
+ - fix "Turkish" mapping -> 'ä' -> 'a'
109
+
110
+ ### 1.3.2 (2019-10-14)
111
+
112
+ - fix language parameter usage with e.g. "de_DE"
113
+ - re-add missing "extra"-mapping chars
114
+
115
+ ### 1.3.1 (2019-10-13)
116
+
117
+ - fix "ASCII::to_slugify" -> remove unicode chars
118
+ - add more test for ascii chars in the mapping
119
+ - fix non ascii chars in the mapping
120
+
121
+ ### 1.3.0 (2019-10-12)
122
+
123
+ - add transliteration "fr" (was supported before, but with chars from other languages)
124
+ - add transliteration "ru" - Passport (2013), ICAO
125
+ - add transliteration "ru" - GOST 7.79-2000(B)
126
+ - add transliteration "el" - greeklish
127
+ - add transliteration "zh"
128
+ - add transliteration "nl"
129
+ - add transliteration "it"
130
+ - add transliteration "mk"
131
+ - add transliteration "pt"
132
+ - add constants -> ASCII::*LANGUAGE_CODES
133
+ - add more special latin chars / (currency) symbols
134
+ - add simple tests for all supported languages
135
+ - optimize "Russian" to ASCII (via "translit.ru")
136
+ - optimize performance of string replacement
137
+ - optimize performance of array merging
138
+ - optimize phpdoc comments
139
+ - "ASCII::to_transliterate" -> use "transliterator_create" + static cache
140
+ - "ASCII::to_ascii" -> fix "remove unsupported chars"
141
+ - "ASCII::to_ascii" -> add some more special chars
142
+ - run/fix static analyse via "pslam" + "phpstan"
143
+ - auto fix code style via "php-cs-fixer"
144
+ - fix transliteration for "german"
145
+ - fix transliteration for "persian" (thanks @mardep)
146
+ - fix transliteration for "polish" (thanks @dariusz.drobisz)
147
+ - fix transliteration for "bulgarian" (thanks @mkosturkov)
148
+ - fix transliteration for "croatian" (thanks @ludifonovac)
149
+ - fix transliteration for "serbian" (thanks @ludifonovac)
150
+ - fix transliteration for "swedish" (thanks @nicholasruunu)
151
+ - fix transliteration for "france" (thanks @sharptsa)
152
+ - fix transliteration for "serbian" (thanks @nikolaposa)
153
+ - fix transliteration for "czech" (thanks @slepic)
154
+
155
+ ### 1.2.3 (2019-09-10)
156
+
157
+ - fix language depending ASCII chars (the order matters)
158
+
159
+ ### 1.2.2 (2019-09-10)
160
+
161
+ - fix bulgarian ASCII chars | thanks @bgphp
162
+
163
+ ### 1.2.1 (2019-09-07)
164
+
165
+ - "charsArray()" -> add access to "ASCII::$ASCII_MAPS*""
166
+
167
+ ### 1.2.0 (2019-09-07)
168
+
169
+ - "to_slugify()" -> use the extra ascii array
170
+
171
+ ### 1.1.0 (2019-09-07)
172
+
173
+ - add + split extra ascii replacements
174
+
175
+ ### 1.0.0 (2019-09-05)
176
+
177
+ - initial commit
vendor/voku/portable-ascii/LICENSE.txt ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (C) 2019 Lars Moelleken
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
vendor/voku/portable-ascii/README.md ADDED
@@ -0,0 +1,428 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [//]: # (AUTO-GENERATED BY "PHP README Helper": base file -> docs/base.md)
2
+ [![Build Status](https://travis-ci.com/voku/portable-ascii.svg?branch=master)](https://travis-ci.com/voku/portable-ascii)
3
+ [![Build status](https://ci.appveyor.com/api/projects/status/gnejjnk7qplr7f5t/branch/master?svg=true)](https://ci.appveyor.com/project/voku/portable-ascii/branch/master)
4
+ [![Coverage Status](https://coveralls.io/repos/voku/portable-ascii/badge.svg?branch=master&service=github)](https://coveralls.io/github/voku/portable-ascii?branch=master)
5
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/997c9bb10d1c4791967bdf2e42013e8e)](https://www.codacy.com/app/voku/portable-ascii)
6
+ [![Latest Stable Version](https://poser.pugx.org/voku/portable-ascii/v/stable)](https://packagist.org/packages/voku/portable-ascii)
7
+ [![Total Downloads](https://poser.pugx.org/voku/portable-ascii/downloads)](https://packagist.org/packages/voku/portable-ascii)
8
+ [![License](https://poser.pugx.org/voku/portable-ascii/license)](https://packagist.org/packages/voku/portable-ascii)
9
+ [![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/moelleken)
10
+ [![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/voku)
11
+
12
+ # 🔡 Portable ASCII
13
+
14
+ ## Description
15
+
16
+ It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your server.
17
+
18
+ The benefit of Portable ASCII is that it is easy to use, easy to bundle.
19
+
20
+ The project based on ...
21
+ + Sean M. Burke's work (https://metacpan.org/pod/Text::Unidecode)
22
+ + Tomaz Solc's work (https://pypi.org/project/Unidecode/)
23
+ + Portable UTF-8 work (https://github.com/voku/portable-utf8)
24
+ + Daniel St. Jules's work (https://github.com/danielstjules/Stringy)
25
+ + Johnny Broadway's work (https://github.com/jbroadway/urlify)
26
+ + and many cherry-picks from "github"-gists and "Stack Overflow"-snippets ...
27
+
28
+ ## Index
29
+
30
+ * [Alternative](#alternative)
31
+ * [Install](#install-portable-ascii-via-composer-require)
32
+ * [Why Portable ASCII?](#why-portable-ascii)
33
+ * [Requirements and Recommendations](#requirements-and-recommendations)
34
+ * [Usage](#usage)
35
+ * [Class methods](#class-methods)
36
+ * [Unit Test](#unit-test)
37
+ * [License and Copyright](#license-and-copyright)
38
+
39
+ ## Alternative
40
+
41
+ If you like a more Object Oriented Way to edit strings, then you can take a look at [voku/Stringy](https://github.com/voku/Stringy), it's a fork of "danielstjules/Stringy" but it used the "Portable ASCII"-Class and some extra methods.
42
+
43
+ ```php
44
+ // Portable ASCII
45
+ use voku\helper\ASCII;
46
+ ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii'
47
+
48
+ // voku/Stringy
49
+ use Stringy\Stringy as S;
50
+ $stringy = S::create('déjà σσς iıii');
51
+ $stringy->toTransliterate(); // 'deja sss iiii'
52
+ ```
53
+
54
+ ## Install "Portable ASCII" via "composer require"
55
+ ```shell
56
+ composer require voku/portable-ascii
57
+ ```
58
+
59
+ ## Why Portable ASCII?[]()
60
+ I need ASCII char handling in different classes and before I added this functions into "Portable UTF-8",
61
+ but this repo is more modular and portable, because it has no dependencies.
62
+
63
+ ## Requirements and Recommendations
64
+
65
+ * No extensions are required to run this library. Portable ASCII only needs PCRE library that is available by default since PHP 4.2.0 and cannot be disabled since PHP 5.3.0. "\u" modifier support in PCRE for ASCII handling is not a must.
66
+ * PHP 7.0 is the minimum requirement
67
+ * PHP 8.0 is also supported
68
+
69
+ ## Usage
70
+
71
+ Example: ASCII::to_ascii()
72
+ ```php
73
+ echo ASCII::to_ascii('�Düsseldorf�', 'de');
74
+
75
+ // will output
76
+ // Duesseldorf
77
+
78
+ echo ASCII::to_ascii('�Düsseldorf�', 'en');
79
+
80
+ // will output
81
+ // Dusseldorf
82
+ ```
83
+
84
+ # Portable ASCII | API
85
+
86
+ The API from the "ASCII"-Class is written as small static methods.
87
+
88
+
89
+ ## Class methods
90
+
91
+ <p id="voku-php-readme-class-methods"></p><table><tr><td><a href="#charsarraybool-replace_extra_symbols-array">charsArray</a>
92
+ </td><td><a href="#charsarraywithmultilanguagevaluesbool-replace_extra_symbols-array">charsArrayWithMultiLanguageValues</a>
93
+ </td><td><a href="#charsarraywithonelanguagestring-language-bool-replace_extra_symbols-bool-asorigreplacearray-array">charsArrayWithOneLanguage</a>
94
+ </td><td><a href="#charsarraywithsinglelanguagevaluesbool-replace_extra_symbols-bool-asorigreplacearray-array">charsArrayWithSingleLanguageValues</a>
95
+ </td></tr><tr><td><a href="#cleanstring-str-bool-normalize_whitespace-bool-keep_non_breaking_space-bool-normalize_msword-bool-remove_invisible_characters-string">clean</a>
96
+ </td><td><a href="#getalllanguages-string">getAllLanguages</a>
97
+ </td><td><a href="#is_asciistring-str-bool">is_ascii</a>
98
+ </td><td><a href="#normalize_mswordstring-str-string">normalize_msword</a>
99
+ </td></tr><tr><td><a href="#normalize_whitespacestring-str-bool-keepnonbreakingspace-bool-keepbidiunicodecontrols-bool-replaceseparatorswithnewline-string">normalize_whitespace</a>
100
+ </td><td><a href="#remove_invisible_charactersstring-str-bool-url_encoded-string-replacement-bool-keep_control_characters-string">remove_invisible_characters</a>
101
+ </td><td><a href="#to_asciistring-str-string-language-bool-remove_unsupported_chars-bool-replace_extra_symbols-bool-use_transliterate-boolnull-replace_single_chars_only-string">to_ascii</a>
102
+ </td><td><a href="#to_filenamestring-str-bool-use_transliterate-string-fallback_char-string">to_filename</a>
103
+ </td></tr><tr><td><a href="#to_slugifystring-str-string-separator-string-language-string-replacements-bool-replace_extra_symbols-bool-use_str_to_lower-bool-use_transliterate-string">to_slugify</a>
104
+ </td><td><a href="#to_transliteratestring-str-stringnull-unknown-bool-strict-string">to_transliterate</a>
105
+ </td></tr></table>
106
+
107
+ #### charsArray(bool $replace_extra_symbols): array
108
+ <a href="#voku-php-readme-class-methods">↑</a>
109
+ Returns an replacement array for ASCII methods.
110
+
111
+ EXAMPLE: <code>
112
+ $array = ASCII::charsArray();
113
+ var_dump($array['ru']['б']); // 'b'
114
+ </code>
115
+
116
+ **Parameters:**
117
+ - `bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound ".</p>`
118
+
119
+ **Return:**
120
+ - `array`
121
+
122
+ --------
123
+
124
+ #### charsArrayWithMultiLanguageValues(bool $replace_extra_symbols): array
125
+ <a href="#voku-php-readme-class-methods">↑</a>
126
+ Returns an replacement array for ASCII methods with a mix of multiple languages.
127
+
128
+ EXAMPLE: <code>
129
+ $array = ASCII::charsArrayWithMultiLanguageValues();
130
+ var_dump($array['b']); // ['β', 'б', 'ဗ', 'ბ', 'ب']
131
+ </code>
132
+
133
+ **Parameters:**
134
+ - `bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound ".</p>`
135
+
136
+ **Return:**
137
+ - `array <p>An array of replacements.</p>`
138
+
139
+ --------
140
+
141
+ #### charsArrayWithOneLanguage(string $language, bool $replace_extra_symbols, bool $asOrigReplaceArray): array
142
+ <a href="#voku-php-readme-class-methods">↑</a>
143
+ Returns an replacement array for ASCII methods with one language.
144
+
145
+ For example, German will map 'ä' to 'ae', while other languages
146
+ will simply return e.g. 'a'.
147
+
148
+ EXAMPLE: <code>
149
+ $array = ASCII::charsArrayWithOneLanguage('ru');
150
+ $tmpKey = \array_search('yo', $array['replace']);
151
+ echo $array['orig'][$tmpKey]; // 'ё'
152
+ </code>
153
+
154
+ **Parameters:**
155
+ - `string $language [optional] <p>Language of the source string e.g.: en, de_at, or de-ch.
156
+ (default is 'en') | ASCII::*_LANGUAGE_CODE</p>`
157
+ - `bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound ".</p>`
158
+ - `bool $asOrigReplaceArray [optional] <p>TRUE === return {orig: string[], replace: string[]}
159
+ array</p>`
160
+
161
+ **Return:**
162
+ - `array <p>An array of replacements.</p>`
163
+
164
+ --------
165
+
166
+ #### charsArrayWithSingleLanguageValues(bool $replace_extra_symbols, bool $asOrigReplaceArray): array
167
+ <a href="#voku-php-readme-class-methods">↑</a>
168
+ Returns an replacement array for ASCII methods with multiple languages.
169
+
170
+ EXAMPLE: <code>
171
+ $array = ASCII::charsArrayWithSingleLanguageValues();
172
+ $tmpKey = \array_search('hnaik', $array['replace']);
173
+ echo $array['orig'][$tmpKey]; // '၌'
174
+ </code>
175
+
176
+ **Parameters:**
177
+ - `bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound ".</p>`
178
+ - `bool $asOrigReplaceArray [optional] <p>TRUE === return {orig: string[], replace: string[]}
179
+ array</p>`
180
+
181
+ **Return:**
182
+ - `array <p>An array of replacements.</p>`
183
+
184
+ --------
185
+
186
+ #### clean(string $str, bool $normalize_whitespace, bool $keep_non_breaking_space, bool $normalize_msword, bool $remove_invisible_characters): string
187
+ <a href="#voku-php-readme-class-methods">↑</a>
188
+ Accepts a string and removes all non-UTF-8 characters from it + extras if needed.
189
+
190
+ **Parameters:**
191
+ - `string $str <p>The string to be sanitized.</p>`
192
+ - `bool $normalize_whitespace [optional] <p>Set to true, if you need to normalize the
193
+ whitespace.</p>`
194
+ - `bool $keep_non_breaking_space [optional] <p>Set to true, to keep non-breaking-spaces, in
195
+ combination with
196
+ $normalize_whitespace</p>`
197
+ - `bool $normalize_msword [optional] <p>Set to true, if you need to normalize MS Word chars
198
+ e.g.: "…"
199
+ => "..."</p>`
200
+ - `bool $remove_invisible_characters [optional] <p>Set to false, if you not want to remove invisible
201
+ characters e.g.: "\0"</p>`
202
+
203
+ **Return:**
204
+ - `string <p>A clean UTF-8 string.</p>`
205
+
206
+ --------
207
+
208
+ #### getAllLanguages(): string[]
209
+ <a href="#voku-php-readme-class-methods">↑</a>
210
+ Get all languages from the constants "ASCII::.*LANGUAGE_CODE".
211
+
212
+ **Parameters:**
213
+ __nothing__
214
+
215
+ **Return:**
216
+ - `string[]`
217
+
218
+ --------
219
+
220
+ #### is_ascii(string $str): bool
221
+ <a href="#voku-php-readme-class-methods">↑</a>
222
+ Checks if a string is 7 bit ASCII.
223
+
224
+ EXAMPLE: <code>
225
+ ASCII::is_ascii('白'); // false
226
+ </code>
227
+
228
+ **Parameters:**
229
+ - `string $str <p>The string to check.</p>`
230
+
231
+ **Return:**
232
+ - `bool <p>
233
+ <strong>true</strong> if it is ASCII<br>
234
+ <strong>false</strong> otherwise
235
+ </p>`
236
+
237
+ --------
238
+
239
+ #### normalize_msword(string $str): string
240
+ <a href="#voku-php-readme-class-methods">↑</a>
241
+ Returns a string with smart quotes, ellipsis characters, and dashes from
242
+ Windows-1252 (commonly used in Word documents) replaced by their ASCII
243
+ equivalents.
244
+
245
+ EXAMPLE: <code>
246
+ ASCII::normalize_msword('„Abcdef…”'); // '"Abcdef..."'
247
+ </code>
248
+
249
+ **Parameters:**
250
+ - `string $str <p>The string to be normalized.</p>`
251
+
252
+ **Return:**
253
+ - `string <p>A string with normalized characters for commonly used chars in Word documents.</p>`
254
+
255
+ --------
256
+
257
+ #### normalize_whitespace(string $str, bool $keepNonBreakingSpace, bool $keepBidiUnicodeControls, bool $replaceSeparatorsWithNewline): string
258
+ <a href="#voku-php-readme-class-methods">↑</a>
259
+ Normalize the whitespace.
260
+
261
+ EXAMPLE: <code>
262
+ ASCII::normalize_whitespace("abc-\xc2\xa0-öäü-\xe2\x80\xaf-\xE2\x80\xAC", true); // "abc-\xc2\xa0-öäü- -"
263
+ </code>
264
+
265
+ **Parameters:**
266
+ - `string $str <p>The string to be normalized.</p>`
267
+ - `bool $keepNonBreakingSpace [optional] <p>Set to true, to keep non-breaking-spaces.</p>`
268
+ - `bool $keepBidiUnicodeControls [optional] <p>Set to true, to keep non-printable (for the web)
269
+ bidirectional text chars.</p>`
270
+ - `bool $replaceSeparatorsWithNewline [optional] <p>Set to true, to convert LINE and PARAGRAPH SEPARATOR with "\n".</p>`
271
+
272
+ **Return:**
273
+ - `string <p>A string with normalized whitespace.</p>`
274
+
275
+ --------
276
+
277
+ #### remove_invisible_characters(string $str, bool $url_encoded, string $replacement, bool $keep_control_characters): string
278
+ <a href="#voku-php-readme-class-methods">↑</a>
279
+ Remove invisible characters from a string.
280
+
281
+ e.g.: This prevents sandwiching null characters between ascii characters, like Java\0script.
282
+
283
+ copy&past from https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/Common.php
284
+
285
+ **Parameters:**
286
+ - `string $str`
287
+ - `bool $url_encoded`
288
+ - `string $replacement`
289
+ - `bool $keep_control_characters`
290
+
291
+ **Return:**
292
+ - `string`
293
+
294
+ --------
295
+
296
+ #### to_ascii(string $str, string $language, bool $remove_unsupported_chars, bool $replace_extra_symbols, bool $use_transliterate, bool|null $replace_single_chars_only): string
297
+ <a href="#voku-php-readme-class-methods">↑</a>
298
+ Returns an ASCII version of the string. A set of non-ASCII characters are
299
+ replaced with their closest ASCII counterparts, and the rest are removed
300
+ by default. The language or locale of the source string can be supplied
301
+ for language-specific transliteration in any of the following formats:
302
+ en, en_GB, or en-GB. For example, passing "de" results in "äöü" mapping
303
+ to "aeoeue" rather than "aou" as in other languages.
304
+
305
+ EXAMPLE: <code>
306
+ ASCII::to_ascii('�Düsseldorf�', 'en'); // Dusseldorf
307
+ </code>
308
+
309
+ **Parameters:**
310
+ - `string $str <p>The input string.</p>`
311
+ - `string $language [optional] <p>Language of the source string.
312
+ (default is 'en') | ASCII::*_LANGUAGE_CODE</p>`
313
+ - `bool $remove_unsupported_chars [optional] <p>Whether or not to remove the
314
+ unsupported characters.</p>`
315
+ - `bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound
316
+ ".</p>`
317
+ - `bool $use_transliterate [optional] <p>Use ASCII::to_transliterate() for unknown chars.</p>`
318
+ - `bool|null $replace_single_chars_only [optional] <p>Single char replacement is better for the
319
+ performance, but some languages need to replace more then one char
320
+ at the same time. | NULL === auto-setting, depended on the
321
+ language</p>`
322
+
323
+ **Return:**
324
+ - `string <p>A string that contains only ASCII characters.</p>`
325
+
326
+ --------
327
+
328
+ #### to_filename(string $str, bool $use_transliterate, string $fallback_char): string
329
+ <a href="#voku-php-readme-class-methods">↑</a>
330
+ Convert given string to safe filename (and keep string case).
331
+
332
+ EXAMPLE: <code>
333
+ ASCII::to_filename('שדגשדג.png', true)); // 'shdgshdg.png'
334
+ </code>
335
+
336
+ **Parameters:**
337
+ - `string $str`
338
+ - `bool $use_transliterate <p>ASCII::to_transliterate() is used by default - unsafe characters are
339
+ simply replaced with hyphen otherwise.</p>`
340
+ - `string $fallback_char`
341
+
342
+ **Return:**
343
+ - `string <p>A string that contains only safe characters for a filename.</p>`
344
+
345
+ --------
346
+
347
+ #### to_slugify(string $str, string $separator, string $language, string[] $replacements, bool $replace_extra_symbols, bool $use_str_to_lower, bool $use_transliterate): string
348
+ <a href="#voku-php-readme-class-methods">↑</a>
349
+ Converts the string into an URL slug. This includes replacing non-ASCII
350
+ characters with their closest ASCII equivalents, removing remaining
351
+ non-ASCII and non-alphanumeric characters, and replacing whitespace with
352
+ $separator. The separator defaults to a single dash, and the string
353
+ is also converted to lowercase. The language of the source string can
354
+ also be supplied for language-specific transliteration.
355
+
356
+ **Parameters:**
357
+ - `string $str`
358
+ - `string $separator [optional] <p>The string used to replace whitespace.</p>`
359
+ - `string $language [optional] <p>Language of the source string.
360
+ (default is 'en') | ASCII::*_LANGUAGE_CODE</p>`
361
+ - `array<string, string> $replacements [optional] <p>A map of replaceable strings.</p>`
362
+ - `bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with "
363
+ pound ".</p>`
364
+ - `bool $use_str_to_lower [optional] <p>Use "string to lower" for the input.</p>`
365
+ - `bool $use_transliterate [optional] <p>Use ASCII::to_transliterate() for unknown
366
+ chars.</p>`
367
+
368
+ **Return:**
369
+ - `string <p>A string that has been converted to an URL slug.</p>`
370
+
371
+ --------
372
+
373
+ #### to_transliterate(string $str, string|null $unknown, bool $strict): string
374
+ <a href="#voku-php-readme-class-methods">↑</a>
375
+ Returns an ASCII version of the string. A set of non-ASCII characters are
376
+ replaced with their closest ASCII counterparts, and the rest are removed
377
+ unless instructed otherwise.
378
+
379
+ EXAMPLE: <code>
380
+ ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii'
381
+ </code>
382
+
383
+ **Parameters:**
384
+ - `string $str <p>The input string.</p>`
385
+ - `string|null $unknown [optional] <p>Character use if character unknown. (default is '?')
386
+ But you can also use NULL to keep the unknown chars.</p>`
387
+ - `bool $strict [optional] <p>Use "transliterator_transliterate()" from PHP-Intl`
388
+
389
+ **Return:**
390
+ - `string <p>A String that contains only ASCII characters.</p>`
391
+
392
+ --------
393
+
394
+
395
+
396
+ ## Unit Test
397
+
398
+ 1) [Composer](https://getcomposer.org) is a prerequisite for running the tests.
399
+
400
+ ```
401
+ composer install
402
+ ```
403
+
404
+ 2) The tests can be executed by running this command from the root directory:
405
+
406
+ ```bash
407
+ ./vendor/bin/phpunit
408
+ ```
409
+
410
+ ### Support
411
+
412
+ For support and donations please visit [Github](https://github.com/voku/portable-ascii/) | [Issues](https://github.com/voku/portable-ascii/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku).
413
+
414
+ For status updates and release announcements please visit [Releases](https://github.com/voku/portable-ascii/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts).
415
+
416
+ For professional support please contact [me](https://about.me/voku).
417
+
418
+ ### Thanks
419
+
420
+ - Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
421
+ - Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
422
+ - Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there!
423
+ - Thanks to [StyleCI](https://styleci.io/) for the simple but powerful code style check.
424
+ - Thanks to [PHPStan](https://github.com/phpstan/phpstan) && [Psalm](https://github.com/vimeo/psalm) for really great Static analysis tools and for discover bugs in the code!
425
+
426
+ ### License and Copyright
427
+
428
+ Released under the MIT License - see `LICENSE.txt` for details.
vendor/voku/portable-ascii/build/composer.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ {
2
+ "require-dev": {
3
+ "voku/php-readme-helper": "~0.6"
4
+ }
5
+ }
vendor/voku/portable-ascii/build/docs/base.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [![Build Status](https://travis-ci.com/voku/portable-ascii.svg?branch=master)](https://travis-ci.com/voku/portable-ascii)
2
+ [![Build status](https://ci.appveyor.com/api/projects/status/gnejjnk7qplr7f5t/branch/master?svg=true)](https://ci.appveyor.com/project/voku/portable-ascii/branch/master)
3
+ [![Coverage Status](https://coveralls.io/repos/voku/portable-ascii/badge.svg?branch=master&service=github)](https://coveralls.io/github/voku/portable-ascii?branch=master)
4
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/997c9bb10d1c4791967bdf2e42013e8e)](https://www.codacy.com/app/voku/portable-ascii)
5
+ [![Latest Stable Version](https://poser.pugx.org/voku/portable-ascii/v/stable)](https://packagist.org/packages/voku/portable-ascii)
6
+ [![Total Downloads](https://poser.pugx.org/voku/portable-ascii/downloads)](https://packagist.org/packages/voku/portable-ascii)
7
+ [![License](https://poser.pugx.org/voku/portable-ascii/license)](https://packagist.org/packages/voku/portable-ascii)
8
+ [![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/moelleken)
9
+ [![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/voku)
10
+
11
+ # 🔡 Portable ASCII
12
+
13
+ ## Description
14
+
15
+ It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your server.
16
+
17
+ The benefit of Portable ASCII is that it is easy to use, easy to bundle.
18
+
19
+ The project based on ...
20
+ + Sean M. Burke's work (https://metacpan.org/pod/Text::Unidecode)
21
+ + Tomaz Solc's work (https://pypi.org/project/Unidecode/)
22
+ + Portable UTF-8 work (https://github.com/voku/portable-utf8)
23
+ + Daniel St. Jules's work (https://github.com/danielstjules/Stringy)
24
+ + Johnny Broadway's work (https://github.com/jbroadway/urlify)
25
+ + and many cherry-picks from "github"-gists and "Stack Overflow"-snippets ...
26
+
27
+ ## Index
28
+
29
+ * [Alternative](#alternative)
30
+ * [Install](#install-portable-ascii-via-composer-require)
31
+ * [Why Portable ASCII?](#why-portable-ascii)
32
+ * [Requirements and Recommendations](#requirements-and-recommendations)
33
+ * [Usage](#usage)
34
+ * [Class methods](#class-methods)
35
+ * [Unit Test](#unit-test)
36
+ * [License and Copyright](#license-and-copyright)
37
+
38
+ ## Alternative
39
+
40
+ If you like a more Object Oriented Way to edit strings, then you can take a look at [voku/Stringy](https://github.com/voku/Stringy), it's a fork of "danielstjules/Stringy" but it used the "Portable ASCII"-Class and some extra methods.
41
+
42
+ ```php
43
+ // Portable ASCII
44
+ use voku\helper\ASCII;
45
+ ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii'
46
+
47
+ // voku/Stringy
48
+ use Stringy\Stringy as S;
49
+ $stringy = S::create('déjà σσς iıii');
50
+ $stringy->toTransliterate(); // 'deja sss iiii'
51
+ ```
52
+
53
+ ## Install "Portable ASCII" via "composer require"
54
+ ```shell
55
+ composer require voku/portable-ascii
56
+ ```
57
+
58
+ ## Why Portable ASCII?[]()
59
+ I need ASCII char handling in different classes and before I added this functions into "Portable UTF-8",
60
+ but this repo is more modular and portable, because it has no dependencies.
61
+
62
+ ## Requirements and Recommendations
63
+
64
+ * No extensions are required to run this library. Portable ASCII only needs PCRE library that is available by default since PHP 4.2.0 and cannot be disabled since PHP 5.3.0. "\u" modifier support in PCRE for ASCII handling is not a must.
65
+ * PHP 7.0 is the minimum requirement
66
+ * PHP 8.0 is also supported
67
+
68
+ ## Usage
69
+
70
+ Example: ASCII::to_ascii()
71
+ ```php
72
+ echo ASCII::to_ascii('�Düsseldorf�', 'de');
73
+
74
+ // will output
75
+ // Duesseldorf
76
+
77
+ echo ASCII::to_ascii('�Düsseldorf�', 'en');
78
+
79
+ // will output
80
+ // Dusseldorf
81
+ ```
82
+
83
+ # Portable ASCII | API
84
+
85
+ The API from the "ASCII"-Class is written as small static methods.
86
+
87
+
88
+ ## Class methods
89
+
90
+ %__functions_index__voku\helper\ASCII__%
91
+
92
+ %__functions_list__voku\helper\ASCII__%
93
+
94
+
95
+ ## Unit Test
96
+
97
+ 1) [Composer](https://getcomposer.org) is a prerequisite for running the tests.
98
+
99
+ ```
100
+ composer install
101
+ ```
102
+
103
+ 2) The tests can be executed by running this command from the root directory:
104
+
105
+ ```bash
106
+ ./vendor/bin/phpunit
107
+ ```
108
+
109
+ ### Support
110
+
111
+ For support and donations please visit [Github](https://github.com/voku/portable-ascii/) | [Issues](https://github.com/voku/portable-ascii/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku).
112
+
113
+ For status updates and release announcements please visit [Releases](https://github.com/voku/portable-ascii/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts).
114
+
115
+ For professional support please contact [me](https://about.me/voku).
116
+
117
+ ### Thanks
118
+
119
+ - Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
120
+ - Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
121
+ - Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there!
122
+ - Thanks to [StyleCI](https://styleci.io/) for the simple but powerful code style check.
123
+ - Thanks to [PHPStan](https://github.com/phpstan/phpstan) && [Psalm](https://github.com/vimeo/psalm) for really great Static analysis tools and for discover bugs in the code!
124
+
125
+ ### License and Copyright
126
+
127
+ Released under the MIT License - see `LICENSE.txt` for details.
vendor/voku/portable-ascii/build/generate_docs.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require __DIR__ . '/../vendor/autoload.php';
4
+ require __DIR__ . '/vendor/autoload.php';
5
+
6
+ $readmeGenerator = new \voku\PhpReadmeHelper\GenerateApi();
7
+ $readmeGenerator->templateMethod = <<<RAW
8
+ #### %name%
9
+ <a href="#voku-php-readme-class-methods">↑</a>
10
+ %description%
11
+
12
+ **Parameters:**
13
+ %params%
14
+
15
+ **Return:**
16
+ %return%
17
+
18
+ --------
19
+
20
+ RAW;
21
+ $readmeText = ($readmeGenerator)->generate(
22
+ __DIR__ . '/../src/voku/helper/ASCII.php',
23
+ __DIR__ . '/docs/base.md'
24
+ );
25
+
26
+ file_put_contents(__DIR__ . '/../README.md', $readmeText);
vendor/voku/portable-ascii/build/generate_max_key_length.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require __DIR__ . '/../vendor/autoload.php';
4
+
5
+ $languages = \voku\helper\ASCII::getAllLanguages();
6
+
7
+ $languagesKeyLengths = [];
8
+ foreach ($languages as $language) {
9
+ $langSpecific = \voku\helper\ASCII::charsArrayWithOneLanguage($language, false, false);
10
+
11
+ $langSpecificKeyLength = \array_map('\mb_strlen', \array_keys($langSpecific));
12
+
13
+ if (count($langSpecificKeyLength) === 0) {
14
+ $languagesKeyLengths[$language] = 0;
15
+ } else {
16
+ $languagesKeyLengths[$language] = \max($langSpecificKeyLength);
17
+ }
18
+ }
19
+
20
+ //var_export($languagesKeyLengths);
vendor/voku/portable-ascii/composer.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "voku/portable-ascii",
3
+ "description": "Portable ASCII library - performance optimized (ascii) string functions for php.",
4
+ "type": "library",
5
+ "keywords": [
6
+ "clean",
7
+ "php",
8
+ "ascii"
9
+ ],
10
+ "homepage": "https://github.com/voku/portable-ascii",
11
+ "license": "MIT",
12
+ "authors": [
13
+ {
14
+ "name": "Lars Moelleken",
15
+ "homepage": "http://www.moelleken.org/"
16
+ }
17
+ ],
18
+ "require": {
19
+ "php": ">=7.0.0"
20
+ },
21
+ "require-dev": {
22
+ "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
23
+ },
24
+ "suggest": {
25
+ "ext-intl": "Use Intl for transliterator_transliterate() support"
26
+ },
27
+ "autoload": {
28
+ "psr-4": {
29
+ "voku\\": "src/voku/"
30
+ }
31
+ },
32
+ "autoload-dev": {
33
+ "psr-4": {
34
+ "voku\\tests\\": "tests/"
35
+ }
36
+ }
37
+ }
vendor/voku/portable-ascii/src/voku/helper/ASCII.php ADDED
@@ -0,0 +1,1440 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ namespace voku\helper;
6
+
7
+ /**
8
+ * @psalm-immutable
9
+ */
10
+ final class ASCII
11
+ {
12
+ //
13
+ // INFO: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
14
+ //
15
+
16
+ const UZBEK_LANGUAGE_CODE = 'uz';
17
+
18
+ const TURKMEN_LANGUAGE_CODE = 'tk';
19
+
20
+ const THAI_LANGUAGE_CODE = 'th';
21
+
22
+ const PASHTO_LANGUAGE_CODE = 'ps';
23
+
24
+ const ORIYA_LANGUAGE_CODE = 'or';
25
+
26
+ const MONGOLIAN_LANGUAGE_CODE = 'mn';
27
+
28
+ const KOREAN_LANGUAGE_CODE = 'ko';
29
+
30
+ const KIRGHIZ_LANGUAGE_CODE = 'ky';
31
+
32
+ const ARMENIAN_LANGUAGE_CODE = 'hy';
33
+
34
+ const BENGALI_LANGUAGE_CODE = 'bn';
35
+
36
+ const BELARUSIAN_LANGUAGE_CODE = 'be';
37
+
38
+ const AMHARIC_LANGUAGE_CODE = 'am';
39
+
40
+ const JAPANESE_LANGUAGE_CODE = 'ja';
41
+
42
+ const CHINESE_LANGUAGE_CODE = 'zh';
43
+
44
+ const DUTCH_LANGUAGE_CODE = 'nl';
45
+
46
+ const ITALIAN_LANGUAGE_CODE = 'it';
47
+
48
+ const MACEDONIAN_LANGUAGE_CODE = 'mk';
49
+
50
+ const PORTUGUESE_LANGUAGE_CODE = 'pt';
51
+
52
+ const GREEKLISH_LANGUAGE_CODE = 'el__greeklish';
53
+
54
+ const GREEK_LANGUAGE_CODE = 'el';
55
+
56
+ const HINDI_LANGUAGE_CODE = 'hi';
57
+
58
+ const SWEDISH_LANGUAGE_CODE = 'sv';
59
+
60
+ const TURKISH_LANGUAGE_CODE = 'tr';
61
+
62
+ const BULGARIAN_LANGUAGE_CODE = 'bg';
63
+
64
+ const HUNGARIAN_LANGUAGE_CODE = 'hu';
65
+
66
+ const MYANMAR_LANGUAGE_CODE = 'my';
67
+
68
+ const CROATIAN_LANGUAGE_CODE = 'hr';
69
+
70
+ const FINNISH_LANGUAGE_CODE = 'fi';
71
+
72
+ const GEORGIAN_LANGUAGE_CODE = 'ka';
73
+
74
+ const RUSSIAN_LANGUAGE_CODE = 'ru';
75
+
76
+ const RUSSIAN_PASSPORT_2013_LANGUAGE_CODE = 'ru__passport_2013';
77
+
78
+ const RUSSIAN_GOST_2000_B_LANGUAGE_CODE = 'ru__gost_2000_b';
79
+
80
+ const UKRAINIAN_LANGUAGE_CODE = 'uk';
81
+
82
+ const KAZAKH_LANGUAGE_CODE = 'kk';
83
+
84
+ const CZECH_LANGUAGE_CODE = 'cs';
85
+
86
+ const DANISH_LANGUAGE_CODE = 'da';
87
+
88
+ const POLISH_LANGUAGE_CODE = 'pl';
89
+
90
+ const ROMANIAN_LANGUAGE_CODE = 'ro';
91
+
92
+ const ESPERANTO_LANGUAGE_CODE = 'eo';
93
+
94
+ const ESTONIAN_LANGUAGE_CODE = 'et';
95
+
96
+ const LATVIAN_LANGUAGE_CODE = 'lv';
97
+
98
+ const LITHUANIAN_LANGUAGE_CODE = 'lt';
99
+
100
+ const NORWEGIAN_LANGUAGE_CODE = 'no';
101
+
102
+ const VIETNAMESE_LANGUAGE_CODE = 'vi';
103
+
104
+ const ARABIC_LANGUAGE_CODE = 'ar';
105
+
106
+ const PERSIAN_LANGUAGE_CODE = 'fa';
107
+
108
+ const SERBIAN_LANGUAGE_CODE = 'sr';
109
+
110
+ const SERBIAN_CYRILLIC_LANGUAGE_CODE = 'sr__cyr';
111
+
112
+ const SERBIAN_LATIN_LANGUAGE_CODE = 'sr__lat';
113
+
114
+ const AZERBAIJANI_LANGUAGE_CODE = 'az';
115
+
116
+ const SLOVAK_LANGUAGE_CODE = 'sk';
117
+
118
+ const FRENCH_LANGUAGE_CODE = 'fr';
119
+
120
+ const FRENCH_AUSTRIAN_LANGUAGE_CODE = 'fr_at';
121
+
122
+ const FRENCH_SWITZERLAND_LANGUAGE_CODE = 'fr_ch';
123
+
124
+ const GERMAN_LANGUAGE_CODE = 'de';
125
+
126
+ const GERMAN_AUSTRIAN_LANGUAGE_CODE = 'de_at';
127
+
128
+ const GERMAN_SWITZERLAND_LANGUAGE_CODE = 'de_ch';
129
+
130
+ const ENGLISH_LANGUAGE_CODE = 'en';
131
+
132
+ const EXTRA_LATIN_CHARS_LANGUAGE_CODE = 'latin';
133
+
134
+ const EXTRA_WHITESPACE_CHARS_LANGUAGE_CODE = ' ';
135
+
136
+ const EXTRA_MSWORD_CHARS_LANGUAGE_CODE = 'msword';
137
+
138
+ /**
139
+ * @var array<string, array<string, string>>|null
140
+ */
141
+ private static $ASCII_MAPS;
142
+
143
+ /**
144
+ * @var array<string, array<string, string>>|null
145
+ */
146
+ private static $ASCII_MAPS_AND_EXTRAS;
147
+
148
+ /**
149
+ * @var array<string, array<string, string>>|null
150
+ */
151
+ private static $ASCII_EXTRAS;
152
+
153
+ /**
154
+ * @var array<string, int>|null
155
+ */
156
+ private static $ORD;
157
+
158
+ /**
159
+ * @var array<string, int>|null
160
+ */
161
+ private static $LANGUAGE_MAX_KEY;
162
+
163
+ /**
164
+ * url: https://en.wikipedia.org/wiki/Wikipedia:ASCII#ASCII_printable_characters
165
+ *
166
+ * @var string
167
+ */
168
+ private static $REGEX_ASCII = "[^\x09\x10\x13\x0A\x0D\x20-\x7E]";
169
+
170
+ /**
171
+ * bidirectional text chars
172
+ *
173
+ * url: https://www.w3.org/International/questions/qa-bidi-unicode-controls
174
+ *
175
+ * @var array<int, string>
176
+ */
177
+ private static $BIDI_UNI_CODE_CONTROLS_TABLE = [
178
+ // LEFT-TO-RIGHT EMBEDDING (use -> dir = "ltr")
179
+ 8234 => "\xE2\x80\xAA",
180
+ // RIGHT-TO-LEFT EMBEDDING (use -> dir = "rtl")
181
+ 8235 => "\xE2\x80\xAB",
182
+ // POP DIRECTIONAL FORMATTING // (use -> </bdo>)
183
+ 8236 => "\xE2\x80\xAC",
184
+ // LEFT-TO-RIGHT OVERRIDE // (use -> <bdo dir = "ltr">)
185
+ 8237 => "\xE2\x80\xAD",
186
+ // RIGHT-TO-LEFT OVERRIDE // (use -> <bdo dir = "rtl">)
187
+ 8238 => "\xE2\x80\xAE",
188
+ // LEFT-TO-RIGHT ISOLATE // (use -> dir = "ltr")
189
+ 8294 => "\xE2\x81\xA6",
190
+ // RIGHT-TO-LEFT ISOLATE // (use -> dir = "rtl")
191
+ 8295 => "\xE2\x81\xA7",
192
+ // FIRST STRONG ISOLATE // (use -> dir = "auto")
193
+ 8296 => "\xE2\x81\xA8",
194
+ // POP DIRECTIONAL ISOLATE
195
+ 8297 => "\xE2\x81\xA9",
196
+ ];
197
+
198
+ /**
199
+ * Get all languages from the constants "ASCII::.*LANGUAGE_CODE".
200
+ *
201
+ * @return string[]
202
+ *
203
+ * @psalm-return array<string, string>
204
+ */
205
+ public static function getAllLanguages(): array
206
+ {
207
+ // init
208
+ static $LANGUAGES = [];
209
+
210
+ if ($LANGUAGES !== []) {
211
+ return $LANGUAGES;
212
+ }
213
+
214
+ foreach ((new \ReflectionClass(__CLASS__))->getConstants() as $constant => $lang) {
215
+ if (\strpos($constant, 'EXTRA') !== false) {
216
+ $LANGUAGES[\strtolower($constant)] = $lang;
217
+ } else {
218
+ $LANGUAGES[\strtolower(\str_replace('_LANGUAGE_CODE', '', $constant))] = $lang;
219
+ }
220
+ }
221
+
222
+ return $LANGUAGES;
223
+ }
224
+
225
+ /**
226
+ * Returns an replacement array for ASCII methods.
227
+ *
228
+ * EXAMPLE: <code>
229
+ * $array = ASCII::charsArray();
230
+ * var_dump($array['ru']['б']); // 'b'
231
+ * </code>
232
+ *
233
+ * @psalm-suppress InvalidNullableReturnType - we use the prepare* methods here, so we don't get NULL here
234
+ *
235
+ * @param bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound ".</p>
236
+ *
237
+ * @psalm-pure
238
+ *
239
+ * @return array
240
+ *
241
+ * @psalm-return array<string, array<string , string>>
242
+ */
243
+ public static function charsArray(bool $replace_extra_symbols = false): array
244
+ {
245
+ if ($replace_extra_symbols) {
246
+ self::prepareAsciiAndExtrasMaps();
247
+
248
+ return self::$ASCII_MAPS_AND_EXTRAS ?? [];
249
+ }
250
+
251
+ self::prepareAsciiMaps();
252
+
253
+ return self::$ASCII_MAPS ?? [];
254
+ }
255
+
256
+ /**
257
+ * Returns an replacement array for ASCII methods with a mix of multiple languages.
258
+ *
259
+ * EXAMPLE: <code>
260
+ * $array = ASCII::charsArrayWithMultiLanguageValues();
261
+ * var_dump($array['b']); // ['β', 'б', 'ဗ', 'ბ', 'ب']
262
+ * </code>
263
+ *
264
+ * @param bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound ".</p>
265
+ *
266
+ * @psalm-pure
267
+ *
268
+ * @return array
269
+ * <p>An array of replacements.</p>
270
+ *
271
+ * @psalm-return array<string, array<int, string>>
272
+ */
273
+ public static function charsArrayWithMultiLanguageValues(bool $replace_extra_symbols = false): array
274
+ {
275
+ /**
276
+ * @var array<string, array>
277
+ */
278
+ static $CHARS_ARRAY = [];
279
+ $cacheKey = '' . $replace_extra_symbols;
280
+
281
+ if (isset($CHARS_ARRAY[$cacheKey])) {
282
+ return $CHARS_ARRAY[$cacheKey];
283
+ }
284
+
285
+ // init
286
+ $return = [];
287
+ $language_all_chars = self::charsArrayWithSingleLanguageValues(
288
+ $replace_extra_symbols,
289
+ false
290
+ );
291
+
292
+ /** @noinspection PhpSillyAssignmentInspection - hack for phpstan */
293
+ /** @var array<string, string> $language_all_chars */
294
+ $language_all_chars = $language_all_chars;
295
+
296
+ /** @noinspection AlterInForeachInspection */
297
+ foreach ($language_all_chars as $key => &$value) {
298
+ $return[$value][] = $key;
299
+ }
300
+
301
+ $CHARS_ARRAY[$cacheKey] = $return;
302
+
303
+ /** @noinspection PhpSillyAssignmentInspection - hack for phpstan */
304
+ /** @var array<string, array<int, string>> $return */
305
+ $return = $return;
306
+
307
+ return $return;
308
+ }
309
+
310
+ /**
311
+ * Returns an replacement array for ASCII methods with one language.
312
+ *
313
+ * For example, German will map 'ä' to 'ae', while other languages
314
+ * will simply return e.g. 'a'.
315
+ *
316
+ * EXAMPLE: <code>
317
+ * $array = ASCII::charsArrayWithOneLanguage('ru');
318
+ * $tmpKey = \array_search('yo', $array['replace']);
319
+ * echo $array['orig'][$tmpKey]; // 'ё'
320
+ * </code>
321
+ *
322
+ * @psalm-suppress InvalidNullableReturnType - we use the prepare* methods here, so we don't get NULL here
323
+ *
324
+ * @param string $language [optional] <p>Language of the source string e.g.: en, de_at, or de-ch.
325
+ * (default is 'en') | ASCII::*_LANGUAGE_CODE</p>
326
+ * @param bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound ".</p>
327
+ * @param bool $asOrigReplaceArray [optional] <p>TRUE === return {orig: string[], replace: string[]}
328
+ * array</p>
329
+ *
330
+ * @psalm-pure
331
+ *
332
+ * @return array
333
+ * <p>An array of replacements.</p>
334
+ *
335
+ * @psalm-return array{orig: string[], replace: string[]}|array<string, string>
336
+ */
337
+ public static function charsArrayWithOneLanguage(
338
+ string $language = self::ENGLISH_LANGUAGE_CODE,
339
+ bool $replace_extra_symbols = false,
340
+ bool $asOrigReplaceArray = true
341
+ ): array {
342
+ $language = self::get_language($language);
343
+
344
+ // init
345
+ /**
346
+ * @var array<string, array>
347
+ */
348
+ static $CHARS_ARRAY = [];
349
+ $cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray;
350
+
351
+ // check static cache
352
+ if (isset($CHARS_ARRAY[$cacheKey][$language])) {
353
+ return $CHARS_ARRAY[$cacheKey][$language];
354
+ }
355
+
356
+ if ($replace_extra_symbols) {
357
+ self::prepareAsciiAndExtrasMaps();
358
+
359
+ /** @noinspection DuplicatedCode */
360
+ if (isset(self::$ASCII_MAPS_AND_EXTRAS[$language])) {
361
+ $tmpArray = self::$ASCII_MAPS_AND_EXTRAS[$language];
362
+
363
+ if ($asOrigReplaceArray) {
364
+ $CHARS_ARRAY[$cacheKey][$language] = [
365
+ 'orig' => \array_keys($tmpArray),
366
+ 'replace' => \array_values($tmpArray),
367
+ ];
368
+ } else {
369
+ $CHARS_ARRAY[$cacheKey][$language] = $tmpArray;
370
+ }
371
+ } else {
372
+ /** @noinspection NestedPositiveIfStatementsInspection */
373
+ if ($asOrigReplaceArray) {
374
+ $CHARS_ARRAY[$cacheKey][$language] = [
375
+ 'orig' => [],
376
+ 'replace' => [],
377
+ ];
378
+ } else {
379
+ $CHARS_ARRAY[$cacheKey][$language] = [];
380
+ }
381
+ }
382
+ } else {
383
+ self::prepareAsciiMaps();
384
+
385
+ /** @noinspection DuplicatedCode */
386
+ if (isset(self::$ASCII_MAPS[$language])) {
387
+ $tmpArray = self::$ASCII_MAPS[$language];
388
+
389
+ if ($asOrigReplaceArray) {
390
+ $CHARS_ARRAY[$cacheKey][$language] = [
391
+ 'orig' => \array_keys($tmpArray),
392
+ 'replace' => \array_values($tmpArray),
393
+ ];
394
+ } else {
395
+ $CHARS_ARRAY[$cacheKey][$language] = $tmpArray;
396
+ }
397
+ } else {
398
+ /** @noinspection NestedPositiveIfStatementsInspection */
399
+ if ($asOrigReplaceArray) {
400
+ $CHARS_ARRAY[$cacheKey][$language] = [
401
+ 'orig' => [],
402
+ 'replace' => [],
403
+ ];
404
+ } else {
405
+ $CHARS_ARRAY[$cacheKey][$language] = [];
406
+ }
407
+ }
408
+ }
409
+
410
+ return $CHARS_ARRAY[$cacheKey][$language] ?? ['orig' => [], 'replace' => []];
411
+ }
412
+
413
+ /**
414
+ * Returns an replacement array for ASCII methods with multiple languages.
415
+ *
416
+ * EXAMPLE: <code>
417
+ * $array = ASCII::charsArrayWithSingleLanguageValues();
418
+ * $tmpKey = \array_search('hnaik', $array['replace']);
419
+ * echo $array['orig'][$tmpKey]; // '၌'
420
+ * </code>
421
+ *
422
+ * @param bool $replace_extra_symbols [optional] <p>Add some more replacements e.g. "£" with " pound ".</p>
423
+ * @param bool $asOrigReplaceArray [optional] <p>TRUE === return {orig: string[], replace: string[]}
424
+ * array</p>
425
+ *
426
+ * @psalm-pure
427
+ *
428
+ * @return array
429
+ * <p>An array of replacements.</p>
430
+ *
431
+ * @psalm-return array{orig: string[], replace: string[]}|array<string, string>
432
+ */
433
+ public static function charsArrayWithSingleLanguageValues(
434
+ bool $replace_extra_symbols = false,
435
+ bool $asOrigReplaceArray = true
436
+ ): array {
437
+ // init
438
+ /**
439
+ * @var array<string,array>
440
+ */
441
+ static $CHARS_ARRAY = [];
442
+ $cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray;
443
+
444
+ if (isset($CHARS_ARRAY[$cacheKey])) {
445
+ return $CHARS_ARRAY[$cacheKey];
446
+ }
447
+
448
+ if ($replace_extra_symbols) {
449
+ self::prepareAsciiAndExtrasMaps();
450
+
451
+ /** @noinspection AlterInForeachInspection */
452
+ /** @psalm-suppress PossiblyNullIterator - we use the prepare* methods here, so we don't get NULL here */
453
+ foreach (self::$ASCII_MAPS_AND_EXTRAS ?? [] as &$map) {
454
+ $CHARS_ARRAY[$cacheKey][] = $map;
455
+ }
456
+ } else {
457
+ self::prepareAsciiMaps();
458
+
459
+ /** @noinspection AlterInForeachInspection */
460
+ /** @psalm-suppress PossiblyNullIterator - we use the prepare* methods here, so we don't get NULL here */
461
+ foreach (self::$ASCII_MAPS ?? [] as &$map) {
462
+ $CHARS_ARRAY[$cacheKey][] = $map;
463
+ }
464
+ }
465
+
466
+ $CHARS_ARRAY[$cacheKey] = \array_merge([], ...$CHARS_ARRAY[$cacheKey]);
467
+
468
+ if ($asOrigReplaceArray) {
469
+ $CHARS_ARRAY[$cacheKey] = [
470
+ 'orig' => \array_keys($CHARS_ARRAY[$cacheKey]),
471
+ 'replace' => \array_values($CHARS_ARRAY[$cacheKey]),
472
+ ];
473
+ }
474
+
475
+ return $CHARS_ARRAY[$cacheKey];
476
+ }
477
+
478
+ /**
479
+ * Accepts a string and removes all non-UTF-8 characters from it + extras if needed.
480
+ *
481
+ * @param string $str <p>The string to be sanitized.</p>
482
+ * @param bool $normalize_whitespace [optional] <p>Set to true, if you need to normalize the
483
+ * whitespace.</p>
484
+ * @param bool $normalize_msword [optional] <p>Set to true, if you need to normalize MS Word chars
485
+ * e.g.: "…"
486
+ * => "..."</p>
487
+ * @param bool $keep_non_breaking_space [optional] <p>Set to true, to keep non-breaking-spaces, in
488
+ * combination with
489
+ * $normalize_whitespace</p>
490
+ * @param bool $remove_invisible_characters [optional] <p>Set to false, if you not want to remove invisible
491
+ * characters e.g.: "\0"</p>
492
+ *
493
+ * @psalm-pure
494
+ *
495
+ * @return string
496
+ * <p>A clean UTF-8 string.</p>
497
+ */
498
+ public static function clean(
499
+ string $str,
500
+ bool $normalize_whitespace = true,
501
+ bool $keep_non_breaking_space = false,
502
+ bool $normalize_msword = true,
503
+ bool $remove_invisible_characters = true
504
+ ): string {
505
+ // http://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string
506
+ // caused connection reset problem on larger strings
507
+
508
+ $regex = '/
509
+ (
510
+ (?: [\x00-\x7F] # single-byte sequences 0xxxxxxx
511
+ | [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
512
+ | [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2
513
+ | [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3
514
+ ){1,100} # ...one or more times
515
+ )
516
+ | ( [\x80-\xBF] ) # invalid byte in range 10000000 - 10111111
517
+ | ( [\xC0-\xFF] ) # invalid byte in range 11000000 - 11111111
518
+ /x';
519
+ $str = (string) \preg_replace($regex, '$1', $str);
520
+
521
+ if ($normalize_whitespace) {
522
+ $str = self::normalize_whitespace($str, $keep_non_breaking_space);
523
+ }
524
+
525
+ if ($normalize_msword) {
526
+ $str = self::normalize_msword($str);
527
+ }
528
+
529
+ if ($remove_invisible_characters) {
530
+ $str = self::remove_invisible_characters($str);
531
+ }
532
+
533
+ return $str;
534
+ }
535
+
536
+ /**
537
+ * Checks if a string is 7 bit ASCII.
538
+ *
539
+ * EXAMPLE: <code>
540
+ * ASCII::is_ascii('白'); // false
541
+ * </code>
542
+ *
543
+ * @param string $str <p>The string to check.</p>
544
+ *
545
+ * @psalm-pure
546
+ *
547
+ * @return bool
548
+ * <p>
549
+ * <strong>true</strong> if it is ASCII<br>
550
+ * <strong>false</strong> otherwise
551
+ * </p>
552
+ */
553
+ public static function is_ascii(string $str): bool
554
+ {
555
+ if ($str === '') {
556
+ return true;
557
+ }
558
+
559
+ return !\preg_match('/' . self::$REGEX_ASCII . '/', $str);
560
+ }
561
+
562
+ /**
563
+ * Returns a string with smart quotes, ellipsis characters, and dashes from
564
+ * Windows-1252 (commonly used in Word documents) replaced by their ASCII
565
+ * equivalents.
566
+ *
567
+ * EXAMPLE: <code>
568
+ * ASCII::normalize_msword('„Abcdef…”'); // '"Abcdef..."'
569
+ * </code>
570
+ *
571
+ * @param string $str <p>The string to be normalized.</p>
572
+ *
573
+ * @psalm-pure
574
+ *
575
+ * @return string
576
+ * <p>A string with normalized characters for commonly used chars in Word documents.</p>