From e3d593090c9537140f54917dcf5a2d45a64a25f5 Mon Sep 17 00:00:00 2001 From: HIcham SADDEK Date: Tue, 6 Apr 2021 03:46:11 +0200 Subject: [PATCH] - Updating documentation. - Adding new functions like array_wrap(). - Complying with latest version of php function notations. - Updating composer. --- README.md | 110 +++++---- composer.json | 2 +- composer.lock | 500 +++++++++++++++++++------------------- src/Helpers/functions.php | 34 ++- 4 files changed, 346 insertions(+), 300 deletions(-) diff --git a/README.md b/README.md index 6c7a440..5fdb7fe 100644 --- a/README.md +++ b/README.md @@ -1,61 +1,85 @@ # Milebits Helpers + A new laravel package including helper functions for every Milebits package. + # How to install -``` + +```bash composer require milebits/helpers ``` + # Available methods -#### Check if a constant exists within a class: -``` -constExists($class, $constant): bool -``` -- Example: `constExists(App\Models\User::class, "CREATED_AT")` will result in `true` -- Example: `constExists($user, "CREATED_AT")` will result in `true` -- Example: `constExists(App\Models\User::class, "RANDOM_VAR")` will result in `false` -- Example: `constExists($user, "RANDOM_VAR")` will result in `false` -#### Get the value of a constant or get default: -``` -constVal($class, $constant, $default): mixed -``` -- Example: `constVal(App\Models\User::class, "CREATED_AT", "JAJA")` will result in `created_at` -- Example: `constVal($user, "CREATED_AT", "JAJA")` will result in `created_at` -- Example: `constVal(App\Models\User::class, "RANDOM_VAR", "JAJA")` will result in `JAJA` -- Example: `constVal($user, "RANDOM_VAR", "JAJA")` will result in `JAJA` -- Example: `constVal(App\Models\User::class, "RANDOM_VAR")` will result in `null` -- Example: `constVal($user, "RANDOM_VAR")` will result in `null` -#### Get the value of a static property or get default: + +#### Check if a constant exists within a class: + +```php +use Illuminate\Support\Facades\Auth; +use function Milebits\Helpers\Helpers\constExists; + +$exists = constExists("App\Models\User", 'constant'); +$exists = constExists(Auth::user(), 'constant'); ``` -staticPropVal($class, $name, $default): mixed + +#### Get the value of a constant or get default: + +```php +use Illuminate\Support\Facades\Auth; +use function Milebits\Helpers\Helpers\constVal; + +$value = constVal(Auth::user(), 'CONSTANT', 'default Value, can be anything'); +$value = constVal("App\Models\User", 'CONSTANT', 'default Value, can be anything'); ``` -- Example: `staticPropVal(App\Models\User::class, "STATICPROP", "JAJA")` will result in the value of the property requested. -- Example: `staticPropVal($user, "STATICPROP", "JAJA")` will result in the value of the property requested. -- Example: `staticPropVal(App\Models\User::class, "NONSTATIC", "JAJA")` will result in `JAJA` -- Example: `staticPropVal($user, "NONSTATIC", "JAJA")` will result in `JAJA` -- Example: `staticPropVal(App\Models\User::class, "NONSTATIC")` will result in `null` -- Example: `staticPropVal($user, "NONSTATIC")` will result in `null` - -#### Get the value of a property or get default: + +#### Get the value of a static property or get default: + +```php +use Illuminate\Support\Facades\Auth; +use function Milebits\Helpers\Helpers\staticPropVal; + +$value = staticPropVal(Auth::user(), "StaticProp", 'default value'); +$value = staticPropVal("App\Models\User", "StaticProp", 'default value'); ``` -propVal($class, $name, $default): mixed + +#### Get the value of a property or get default: + +```php +use Illuminate\Support\Facades\Auth; +use function Milebits\Helpers\Helpers\propVal; + +$value = propVal(Auth::user(), 'Property', 'default value'); +$value = propVal("App\Models\User", 'Property', 'default value'); ``` -- Example: `propVal(App\Models\User::class, "prop", "JAJA")` will result in the value of the property requested. -- Example: `propVal($user, "prop", "JAJA")` will result in the value of the property requested. -- Example: `propVal(App\Models\User::class, "non_prop", "JAJA")` will result in `JAJA` -- Example: `propVal($user, "non_prop", "JAJA")` will result in `JAJA` -- Example: `propVal(App\Models\User::class, "non_prop")` will result in `null` -- Example: `propVal($user, "non_prop")` will result in `null` #### Check if a class has a certain trait + +```php +use Illuminate\Database\Eloquent\SoftDeletes; +use Illuminate\Support\Facades\Auth; +use function Milebits\Helpers\Helpers\hasTrait; + +$hasSoftDeletes = hasTrait(Auth::user(), SoftDeletes::class); +$hasSoftDeletes = hasTrait("App\Models\User", SoftDeletes::class); ``` -hasTrait($object, $trait): bool + +#### Wrap something in an array + +```php +use function Milebits\Helpers\Helpers\array_wrap; + +$value = "test"; +$array = ["arrayItem"]; + +$wrap = array_wrap($value); +$wrap = array_wrap($array); ``` -- Example: `hasTrait($user, SoftDeletes::class)` will return true if the user has the SoftDeletes Trait. -- Example: `hasTrait($user, HasPosts::class)` will return true if the user hasn't got the HasPosts Trait -- Example: `hasTrait(App\Models\User, SoftDeletes::class)` will return true if the user class has the SoftDeletes Trait. -- Example: `hasTrait(App\Models\User, HasPosts::class)` will return true if the user class hasn't got the HasPosts Trait. # Contributions -If in any case while using this package, and you which to request a new functionality to it, please contact us at suggestions@os.milebits.com and mention the package you are willing to contribute or suggest a new functionality. + +If in any case while using this package, and you which to request a new functionality to it, please contact us at +suggestions@os.milebits.com and mention the package you are willing to contribute or suggest a new functionality. # Vulnerabilities -If in any case while using this package, you encounter security issues or security vulnerabilities, please do report them as soon as possible by issuing an issue here in Github or by sending an email to security@os.milebits.com with the mention **Vulnerability Report milebits/helpers** as your subject. \ No newline at end of file + +If in any case while using this package, you encounter security issues or security vulnerabilities, please do report +them as soon as possible by issuing an issue here in Github or by sending an email to security@os.milebits.com with the +mention **Vulnerability Report milebits/helpers** as your subject. \ No newline at end of file diff --git a/composer.json b/composer.json index dee32be..d0496ea 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ } ], "require": { - "php": ">=7.4", + "php": ">=8.0", "laravel/framework": "^6|^7|^8" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 2f3cd25..c131a91 100644 --- a/composer.lock +++ b/composer.lock @@ -434,16 +434,16 @@ }, { "name": "laravel/framework", - "version": "v8.27.0", + "version": "v8.35.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "a6680d98f9dadaa363aa7d5218517a08706cee64" + "reference": "d118c0df39e7524131176aaf76493eae63a8a602" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/a6680d98f9dadaa363aa7d5218517a08706cee64", - "reference": "a6680d98f9dadaa363aa7d5218517a08706cee64", + "url": "https://api.github.com/repos/laravel/framework/zipball/d118c0df39e7524131176aaf76493eae63a8a602", + "reference": "d118c0df39e7524131176aaf76493eae63a8a602", "shasum": "" }, "require": { @@ -551,7 +551,7 @@ "phpunit/phpunit": "Required to use assertions and run tests (^8.5.8|^9.3.3).", "predis/predis": "Required to use the predis connector (^1.1.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0).", "symfony/cache": "Required to PSR-6 cache bridge (^5.1.4).", "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", @@ -598,20 +598,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-02-09T15:14:54+00:00" + "time": "2021-03-30T21:34:17+00:00" }, { "name": "league/commonmark", - "version": "1.5.7", + "version": "1.5.8", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "11df9b36fd4f1d2b727a73bf14931d81373b9a54" + "reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/11df9b36fd4f1d2b727a73bf14931d81373b9a54", - "reference": "11df9b36fd4f1d2b727a73bf14931d81373b9a54", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf", + "reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf", "shasum": "" }, "require": { @@ -699,7 +699,7 @@ "type": "tidelift" } ], - "time": "2020-10-31T13:49:32+00:00" + "time": "2021-03-28T18:51:39+00:00" }, { "name": "league/flysystem", @@ -950,16 +950,16 @@ }, { "name": "nesbot/carbon", - "version": "2.45.1", + "version": "2.46.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "528783b188bdb853eb21239b1722831e0f000a8d" + "reference": "2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/528783b188bdb853eb21239b1722831e0f000a8d", - "reference": "528783b188bdb853eb21239b1722831e0f000a8d", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4", + "reference": "2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4", "shasum": "" }, "require": { @@ -1039,7 +1039,7 @@ "type": "tidelift" } ], - "time": "2021-02-11T18:30:17+00:00" + "time": "2021-02-24T17:30:44+00:00" }, { "name": "opis/closure", @@ -1177,27 +1177,22 @@ }, { "name": "psr/container", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -1210,7 +1205,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -1224,9 +1219,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" + "source": "https://github.com/php-fig/container/tree/1.1.1" }, - "time": "2017-02-14T16:28:37+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { "name": "psr/event-dispatcher", @@ -1550,20 +1545,20 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v6.2.5", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "698a6a9f54d7eb321274de3ad19863802c879fb7" + "reference": "15f7faf8508e04471f666633addacf54c0ab5933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/698a6a9f54d7eb321274de3ad19863802c879fb7", - "reference": "698a6a9f54d7eb321274de3ad19863802c879fb7", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/15f7faf8508e04471f666633addacf54c0ab5933", + "reference": "15f7faf8508e04471f666633addacf54c0ab5933", "shasum": "" }, "require": { - "egulias/email-validator": "^2.0", + "egulias/email-validator": "^2.0|^3.1", "php": ">=7.0.0", "symfony/polyfill-iconv": "^1.0", "symfony/polyfill-intl-idn": "^1.10", @@ -1609,7 +1604,7 @@ ], "support": { "issues": "https://github.com/swiftmailer/swiftmailer/issues", - "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.5" + "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.7" }, "funding": [ { @@ -1621,20 +1616,20 @@ "type": "tidelift" } ], - "time": "2021-01-12T09:35:59+00:00" + "time": "2021-03-09T12:30:35+00:00" }, { "name": "symfony/console", - "version": "v5.2.3", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "89d4b176d12a2946a1ae4e34906a025b7b6b135a" + "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/89d4b176d12a2946a1ae4e34906a025b7b6b135a", - "reference": "89d4b176d12a2946a1ae4e34906a025b7b6b135a", + "url": "https://api.github.com/repos/symfony/console/zipball/35f039df40a3b335ebf310f244cb242b3a83ac8d", + "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d", "shasum": "" }, "require": { @@ -1702,7 +1697,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.2.3" + "source": "https://github.com/symfony/console/tree/v5.2.6" }, "funding": [ { @@ -1718,11 +1713,11 @@ "type": "tidelift" } ], - "time": "2021-01-28T22:06:19+00:00" + "time": "2021-03-28T09:42:18+00:00" }, { "name": "symfony/css-selector", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -1767,7 +1762,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.2.3" + "source": "https://github.com/symfony/css-selector/tree/v5.2.4" }, "funding": [ { @@ -1854,16 +1849,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.2.3", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "48f18b3609e120ea66d59142c23dc53e9562c26d" + "reference": "bdb7fb4188da7f4211e4b88350ba0dfdad002b03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/48f18b3609e120ea66d59142c23dc53e9562c26d", - "reference": "48f18b3609e120ea66d59142c23dc53e9562c26d", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/bdb7fb4188da7f4211e4b88350ba0dfdad002b03", + "reference": "bdb7fb4188da7f4211e4b88350ba0dfdad002b03", "shasum": "" }, "require": { @@ -1903,7 +1898,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.2.3" + "source": "https://github.com/symfony/error-handler/tree/v5.2.6" }, "funding": [ { @@ -1919,20 +1914,20 @@ "type": "tidelift" } ], - "time": "2021-01-28T22:06:19+00:00" + "time": "2021-03-16T09:07:47+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367" + "reference": "d08d6ec121a425897951900ab692b612a61d6240" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4f9760f8074978ad82e2ce854dff79a71fe45367", - "reference": "4f9760f8074978ad82e2ce854dff79a71fe45367", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d08d6ec121a425897951900ab692b612a61d6240", + "reference": "d08d6ec121a425897951900ab692b612a61d6240", "shasum": "" }, "require": { @@ -1988,7 +1983,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.3" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.4" }, "funding": [ { @@ -2004,7 +1999,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:36:42+00:00" + "time": "2021-02-18T17:12:37+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2087,16 +2082,16 @@ }, { "name": "symfony/finder", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4adc8d172d602008c204c2e16956f99257248e03" + "reference": "0d639a0943822626290d169965804f79400e6a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4adc8d172d602008c204c2e16956f99257248e03", - "reference": "4adc8d172d602008c204c2e16956f99257248e03", + "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04", + "reference": "0d639a0943822626290d169965804f79400e6a04", "shasum": "" }, "require": { @@ -2128,7 +2123,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.3" + "source": "https://github.com/symfony/finder/tree/v5.2.4" }, "funding": [ { @@ -2144,7 +2139,7 @@ "type": "tidelift" } ], - "time": "2021-01-28T22:06:19+00:00" + "time": "2021-02-15T18:55:04+00:00" }, { "name": "symfony/http-client-contracts", @@ -2227,16 +2222,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "20c554c0f03f7cde5ce230ed248470cccbc34c36" + "reference": "54499baea7f7418bce7b5ec92770fd0799e8e9bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/20c554c0f03f7cde5ce230ed248470cccbc34c36", - "reference": "20c554c0f03f7cde5ce230ed248470cccbc34c36", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/54499baea7f7418bce7b5ec92770fd0799e8e9bf", + "reference": "54499baea7f7418bce7b5ec92770fd0799e8e9bf", "shasum": "" }, "require": { @@ -2280,7 +2275,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.2.3" + "source": "https://github.com/symfony/http-foundation/tree/v5.2.4" }, "funding": [ { @@ -2296,20 +2291,20 @@ "type": "tidelift" } ], - "time": "2021-02-03T04:42:09+00:00" + "time": "2021-02-25T17:16:57+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.2.3", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "89bac04f29e7b0b52f9fa6a4288ca7a8f90a1a05" + "reference": "f34de4c61ca46df73857f7f36b9a3805bdd7e3b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/89bac04f29e7b0b52f9fa6a4288ca7a8f90a1a05", - "reference": "89bac04f29e7b0b52f9fa6a4288ca7a8f90a1a05", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f34de4c61ca46df73857f7f36b9a3805bdd7e3b2", + "reference": "f34de4c61ca46df73857f7f36b9a3805bdd7e3b2", "shasum": "" }, "require": { @@ -2344,7 +2339,7 @@ "psr/log-implementation": "1.0" }, "require-dev": { - "psr/cache": "~1.0", + "psr/cache": "^1.0|^2.0|^3.0", "symfony/browser-kit": "^4.4|^5.0", "symfony/config": "^5.0", "symfony/console": "^4.4|^5.0", @@ -2392,7 +2387,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.2.3" + "source": "https://github.com/symfony/http-kernel/tree/v5.2.6" }, "funding": [ { @@ -2408,20 +2403,20 @@ "type": "tidelift" } ], - "time": "2021-02-03T04:51:58+00:00" + "time": "2021-03-29T05:16:58+00:00" }, { "name": "symfony/mime", - "version": "v5.2.3", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "7dee6a43493f39b51ff6c5bb2bd576fe40a76c86" + "reference": "1b2092244374cbe48ae733673f2ca0818b37197b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/7dee6a43493f39b51ff6c5bb2bd576fe40a76c86", - "reference": "7dee6a43493f39b51ff6c5bb2bd576fe40a76c86", + "url": "https://api.github.com/repos/symfony/mime/zipball/1b2092244374cbe48ae733673f2ca0818b37197b", + "reference": "1b2092244374cbe48ae733673f2ca0818b37197b", "shasum": "" }, "require": { @@ -2432,12 +2427,13 @@ "symfony/polyfill-php80": "^1.15" }, "conflict": { + "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<4.4" }, "require-dev": { - "egulias/email-validator": "^2.1.10", + "egulias/email-validator": "^2.1.10|^3.1", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/property-access": "^4.4|^5.1", @@ -2474,7 +2470,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.2.3" + "source": "https://github.com/symfony/mime/tree/v5.2.6" }, "funding": [ { @@ -2490,11 +2486,11 @@ "type": "tidelift" } ], - "time": "2021-02-02T06:10:15+00:00" + "time": "2021-03-12T13:18:39+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2553,7 +2549,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" }, "funding": [ { @@ -2573,16 +2569,16 @@ }, { "name": "symfony/polyfill-iconv", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "b34bfb8c4c22650ac080d2662ae3502e5f2f4ae6" + "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/b34bfb8c4c22650ac080d2662ae3502e5f2f4ae6", - "reference": "b34bfb8c4c22650ac080d2662ae3502e5f2f4ae6", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/06fb361659649bcfd6a208a0f1fcaf4e827ad342", + "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342", "shasum": "" }, "require": { @@ -2633,7 +2629,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.22.1" }, "funding": [ { @@ -2649,20 +2645,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af" + "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/267a9adeb8ecb8071040a740930e077cdfb987af", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170", + "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170", "shasum": "" }, "require": { @@ -2714,7 +2710,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1" }, "funding": [ { @@ -2730,20 +2726,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44" + "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44", - "reference": "0eb8293dbbcd6ef6bf81404c9ce7d95bcdf34f44", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", + "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", "shasum": "" }, "require": { @@ -2801,7 +2797,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.1" }, "funding": [ { @@ -2817,20 +2813,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "6e971c891537eb617a00bb07a43d182a6915faba" + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/6e971c891537eb617a00bb07a43d182a6915faba", - "reference": "6e971c891537eb617a00bb07a43d182a6915faba", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", "shasum": "" }, "require": { @@ -2885,7 +2881,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" }, "funding": [ { @@ -2901,20 +2897,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T17:09:11+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13" + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", "shasum": "" }, "require": { @@ -2965,7 +2961,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" }, "funding": [ { @@ -2981,11 +2977,11 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -3041,7 +3037,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" }, "funding": [ { @@ -3061,7 +3057,7 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -3120,7 +3116,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" }, "funding": [ { @@ -3140,7 +3136,7 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", @@ -3203,7 +3199,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" }, "funding": [ { @@ -3223,7 +3219,7 @@ }, { "name": "symfony/process", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -3265,7 +3261,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.2.3" + "source": "https://github.com/symfony/process/tree/v5.2.4" }, "funding": [ { @@ -3285,16 +3281,16 @@ }, { "name": "symfony/routing", - "version": "v5.2.3", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "348b5917e56546c6d96adbf21d7f92c9ef563661" + "reference": "31fba555f178afd04d54fd26953501b2c3f0c6e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/348b5917e56546c6d96adbf21d7f92c9ef563661", - "reference": "348b5917e56546c6d96adbf21d7f92c9ef563661", + "url": "https://api.github.com/repos/symfony/routing/zipball/31fba555f178afd04d54fd26953501b2c3f0c6e6", + "reference": "31fba555f178afd04d54fd26953501b2c3f0c6e6", "shasum": "" }, "require": { @@ -3355,7 +3351,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.2.3" + "source": "https://github.com/symfony/routing/tree/v5.2.6" }, "funding": [ { @@ -3371,7 +3367,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-03-14T13:53:33+00:00" }, { "name": "symfony/service-contracts", @@ -3454,16 +3450,16 @@ }, { "name": "symfony/string", - "version": "v5.2.3", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "c95468897f408dd0aca2ff582074423dd0455122" + "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/c95468897f408dd0aca2ff582074423dd0455122", - "reference": "c95468897f408dd0aca2ff582074423dd0455122", + "url": "https://api.github.com/repos/symfony/string/zipball/ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", + "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", "shasum": "" }, "require": { @@ -3517,7 +3513,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.2.3" + "source": "https://github.com/symfony/string/tree/v5.2.6" }, "funding": [ { @@ -3533,20 +3529,20 @@ "type": "tidelift" } ], - "time": "2021-01-25T15:14:59+00:00" + "time": "2021-03-17T17:12:15+00:00" }, { "name": "symfony/translation", - "version": "v5.2.3", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "c021864d4354ee55160ddcfd31dc477a1bc77949" + "reference": "2cc7f45d96db9adfcf89adf4401d9dfed509f4e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/c021864d4354ee55160ddcfd31dc477a1bc77949", - "reference": "c021864d4354ee55160ddcfd31dc477a1bc77949", + "url": "https://api.github.com/repos/symfony/translation/zipball/2cc7f45d96db9adfcf89adf4401d9dfed509f4e1", + "reference": "2cc7f45d96db9adfcf89adf4401d9dfed509f4e1", "shasum": "" }, "require": { @@ -3563,7 +3559,7 @@ "symfony/yaml": "<4.4" }, "provide": { - "symfony/translation-implementation": "2.0" + "symfony/translation-implementation": "2.3" }, "require-dev": { "psr/log": "~1.0", @@ -3610,7 +3606,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.2.3" + "source": "https://github.com/symfony/translation/tree/v5.2.6" }, "funding": [ { @@ -3626,7 +3622,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-03-23T19:33:48+00:00" }, { "name": "symfony/translation-contracts", @@ -3708,16 +3704,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.2.3", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "72ca213014a92223a5d18651ce79ef441c12b694" + "reference": "89412a68ea2e675b4e44f260a5666729f77f668e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/72ca213014a92223a5d18651ce79ef441c12b694", - "reference": "72ca213014a92223a5d18651ce79ef441c12b694", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89412a68ea2e675b4e44f260a5666729f77f668e", + "reference": "89412a68ea2e675b4e44f260a5666729f77f668e", "shasum": "" }, "require": { @@ -3776,7 +3772,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.2.3" + "source": "https://github.com/symfony/var-dumper/tree/v5.2.6" }, "funding": [ { @@ -3792,7 +3788,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-03-28T09:42:18+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -4003,30 +3999,35 @@ }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -4050,9 +4051,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2021-03-09T10:59:23+00:00" } ], "packages-dev": [ @@ -4127,20 +4128,22 @@ }, { "name": "fakerphp/faker", - "version": "v1.13.0", + "version": "v1.14.1", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "ab3f5364d01f2c2c16113442fb987d26e4004913" + "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/ab3f5364d01f2c2c16113442fb987d26e4004913", - "reference": "ab3f5364d01f2c2c16113442fb987d26e4004913", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", + "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^7.1 || ^8.0", + "psr/container": "^1.0", + "symfony/deprecation-contracts": "^2.2" }, "conflict": { "fzaninotto/faker": "*" @@ -4148,9 +4151,20 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-intl": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.4.2" + "symfony/phpunit-bridge": "^4.4 || ^5.2" + }, + "suggest": { + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v1.15-dev" + } + }, "autoload": { "psr-4": { "Faker\\": "src/Faker/" @@ -4173,22 +4187,22 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.13.0" + "source": "https://github.com/FakerPHP/Faker/tree/v.1.14.1" }, - "time": "2020-12-18T16:50:48+00:00" + "time": "2021-03-30T06:27:33+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", "shasum": "" }, "require": { @@ -4248,9 +4262,9 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.7.0" + "source": "https://github.com/guzzle/psr7/tree/1.8.1" }, - "time": "2020-09-30T07:37:11+00:00" + "time": "2021-03-21T16:25:00+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -4305,16 +4319,16 @@ }, { "name": "mockery/mockery", - "version": "1.4.2", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "20cab678faed06fac225193be281ea0fddb43b93" + "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/20cab678faed06fac225193be281ea0fddb43b93", - "reference": "20cab678faed06fac225193be281ea0fddb43b93", + "url": "https://api.github.com/repos/mockery/mockery/zipball/d1339f64479af1bee0e82a0413813fe5345a54ea", + "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea", "shasum": "" }, "require": { @@ -4371,9 +4385,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/master" + "source": "https://github.com/mockery/mockery/tree/1.4.3" }, - "time": "2020-08-11T18:10:13+00:00" + "time": "2021-02-24T09:51:49+00:00" }, { "name": "myclabs/deep-copy", @@ -4491,25 +4505,25 @@ }, { "name": "orchestra/testbench", - "version": "v6.12.1", + "version": "v6.16.0", "source": { "type": "git", "url": "https://github.com/orchestral/testbench.git", - "reference": "717c09aab753f8d56d442227cb2c5b14a883c4ff" + "reference": "5bd3a622eeb6f5361b90089791d7b2f35f034b91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/717c09aab753f8d56d442227cb2c5b14a883c4ff", - "reference": "717c09aab753f8d56d442227cb2c5b14a883c4ff", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/5bd3a622eeb6f5361b90089791d7b2f35f034b91", + "reference": "5bd3a622eeb6f5361b90089791d7b2f35f034b91", "shasum": "" }, "require": { "laravel/framework": "^8.25", "mockery/mockery": "^1.4.2", - "orchestra/testbench-core": "^6.15.2", + "orchestra/testbench-core": "^6.20", "php": "^7.3 || ^8.0", - "phpunit/phpunit": "^8.4 || ^9.3", - "spatie/laravel-ray": "^1.9.3" + "phpunit/phpunit": "^8.4 || ^9.3.3", + "spatie/laravel-ray": "^1.17.1" }, "type": "library", "extra": { @@ -4540,7 +4554,7 @@ ], "support": { "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v6.12.1" + "source": "https://github.com/orchestral/testbench/tree/v6.16.0" }, "funding": [ { @@ -4552,20 +4566,20 @@ "type": "liberapay" } ], - "time": "2021-02-13T10:12:10+00:00" + "time": "2021-03-30T23:05:25+00:00" }, { "name": "orchestra/testbench-core", - "version": "v6.15.2", + "version": "v6.20.0", "source": { "type": "git", "url": "https://github.com/orchestral/testbench-core.git", - "reference": "9bece6191cd6b48c3d6f3e42a687209102e57cb4" + "reference": "5789b74816e3c3f3d4bd2c419fb08ee2dd66b177" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/9bece6191cd6b48c3d6f3e42a687209102e57cb4", - "reference": "9bece6191cd6b48c3d6f3e42a687209102e57cb4", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/5789b74816e3c3f3d4bd2c419fb08ee2dd66b177", + "reference": "5789b74816e3c3f3d4bd2c419fb08ee2dd66b177", "shasum": "" }, "require": { @@ -4575,18 +4589,19 @@ "vlucas/phpdotenv": "^5.1" }, "require-dev": { - "laravel/framework": "^8.25", + "laravel/framework": "^8.26", "laravel/laravel": "8.x-dev", "mockery/mockery": "^1.4.2", "orchestra/canvas": "^6.1", - "phpunit/phpunit": "^8.4 || ^9.3" + "phpunit/phpunit": "^8.4 || ^9.3.3 || ^10.0", + "symfony/process": "^5.0" }, "suggest": { - "laravel/framework": "Required for testing (^8.25).", + "laravel/framework": "Required for testing (^8.26).", "mockery/mockery": "Allow using Mockery for testing (^1.4.2).", "orchestra/testbench-browser-kit": "Allow using legacy Laravel BrowserKit for testing (^6.0).", "orchestra/testbench-dusk": "Allow using Laravel Dusk for testing (^6.0).", - "phpunit/phpunit": "Allow using PHPUnit for testing (^8.4 || ^9.0)." + "phpunit/phpunit": "Allow using PHPUnit for testing (^8.4|^9.3.3)." }, "bin": [ "testbench" @@ -4595,11 +4610,6 @@ "extra": { "branch-alias": { "dev-master": "6.0-dev" - }, - "laravel": { - "providers": [ - "Orchestra\\Testbench\\Foundation\\TestbenchServiceProvider" - ] } }, "autoload": { @@ -4642,7 +4652,7 @@ "type": "liberapay" } ], - "time": "2021-02-13T09:33:45+00:00" + "time": "2021-03-30T22:52:56+00:00" }, { "name": "phar-io/manifest", @@ -4706,16 +4716,16 @@ }, { "name": "phar-io/version", - "version": "3.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451" + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { @@ -4751,9 +4761,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.0.4" + "source": "https://github.com/phar-io/version/tree/3.1.0" }, - "time": "2020-12-13T23:18:30+00:00" + "time": "2021-02-23T14:00:09+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -4915,16 +4925,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.12.2", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "245710e971a030f42e08f4912863805570f23d39" + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", - "reference": "245710e971a030f42e08f4912863805570f23d39", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", "shasum": "" }, "require": { @@ -4976,22 +4986,22 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.12.2" + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" }, - "time": "2020-12-19T10:15:11+00:00" + "time": "2021-03-17T13:42:18+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.5", + "version": "9.2.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" + "reference": "f6293e1b30a2354e8428e004689671b83871edde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", + "reference": "f6293e1b30a2354e8428e004689671b83871edde", "shasum": "" }, "require": { @@ -5047,7 +5057,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" }, "funding": [ { @@ -5055,7 +5065,7 @@ "type": "github" } ], - "time": "2020-11-28T06:44:49+00:00" + "time": "2021-03-28T07:26:59+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5300,16 +5310,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.2", + "version": "9.5.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4" + "reference": "c73c6737305e779771147af66c96ca6a7ed8a741" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f661659747f2f87f9e72095bb207bceb0f151cb4", - "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c73c6737305e779771147af66c96ca6a7ed8a741", + "reference": "c73c6737305e779771147af66c96ca6a7ed8a741", "shasum": "" }, "require": { @@ -5387,7 +5397,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.4" }, "funding": [ { @@ -5399,7 +5409,7 @@ "type": "github" } ], - "time": "2021-02-02T14:45:58+00:00" + "time": "2021-03-23T07:16:29+00:00" }, { "name": "psr/http-message", @@ -6526,16 +6536,16 @@ }, { "name": "spatie/laravel-ray", - "version": "1.12.6", + "version": "1.17.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ray.git", - "reference": "9774088a826cc5aaa2710720667047852b2a5538" + "reference": "c25f2c2cdf3221abce3b1250cb7296721acfd2b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/9774088a826cc5aaa2710720667047852b2a5538", - "reference": "9774088a826cc5aaa2710720667047852b2a5538", + "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/c25f2c2cdf3221abce3b1250cb7296721acfd2b8", + "reference": "c25f2c2cdf3221abce3b1250cb7296721acfd2b8", "shasum": "" }, "require": { @@ -6546,7 +6556,7 @@ "illuminate/support": "^7.20|^8.13", "php": "^7.3|^8.0", "spatie/backtrace": "^1.0", - "spatie/ray": "^1.19", + "spatie/ray": "^1.21.2", "symfony/stopwatch": "4.2|^5.1", "zbateson/mail-mime-parser": "^1.3.1" }, @@ -6590,7 +6600,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-ray/issues", - "source": "https://github.com/spatie/laravel-ray/tree/1.12.6" + "source": "https://github.com/spatie/laravel-ray/tree/1.17.1" }, "funding": [ { @@ -6602,7 +6612,7 @@ "type": "other" } ], - "time": "2021-02-10T19:13:17+00:00" + "time": "2021-03-13T12:50:02+00:00" }, { "name": "spatie/macroable", @@ -6656,16 +6666,16 @@ }, { "name": "spatie/ray", - "version": "1.19.4", + "version": "1.21.2", "source": { "type": "git", "url": "https://github.com/spatie/ray.git", - "reference": "fcc54e2ecd00a935fc5d79d8b7f8523a4252f9f6" + "reference": "829676b1b6791aba6660fcca6f553d72c894a0ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ray/zipball/fcc54e2ecd00a935fc5d79d8b7f8523a4252f9f6", - "reference": "fcc54e2ecd00a935fc5d79d8b7f8523a4252f9f6", + "url": "https://api.github.com/repos/spatie/ray/zipball/829676b1b6791aba6660fcca6f553d72c894a0ae", + "reference": "829676b1b6791aba6660fcca6f553d72c894a0ae", "shasum": "" }, "require": { @@ -6673,7 +6683,7 @@ "ext-json": "*", "php": "^7.3|^8.0", "ramsey/uuid": "^3.0|^4.1", - "spatie/backtrace": "^1.0", + "spatie/backtrace": "^1.1", "spatie/macroable": "^1.0", "symfony/stopwatch": "^4.0|^5.1", "symfony/var-dumper": "^4.2|^5.1" @@ -6715,7 +6725,7 @@ ], "support": { "issues": "https://github.com/spatie/ray/issues", - "source": "https://github.com/spatie/ray/tree/1.19.4" + "source": "https://github.com/spatie/ray/tree/1.21.2" }, "funding": [ { @@ -6727,11 +6737,11 @@ "type": "other" } ], - "time": "2021-02-11T08:10:15+00:00" + "time": "2021-03-04T11:06:19+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.2.3", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -6773,7 +6783,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.2.3" + "source": "https://github.com/symfony/stopwatch/tree/v5.2.4" }, "funding": [ { @@ -6793,16 +6803,16 @@ }, { "name": "symfony/yaml", - "version": "v5.2.3", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "338cddc6d74929f6adf19ca5682ac4b8e109cdb0" + "reference": "298a08ddda623485208506fcee08817807a251dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/338cddc6d74929f6adf19ca5682ac4b8e109cdb0", - "reference": "338cddc6d74929f6adf19ca5682ac4b8e109cdb0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/298a08ddda623485208506fcee08817807a251dd", + "reference": "298a08ddda623485208506fcee08817807a251dd", "shasum": "" }, "require": { @@ -6848,7 +6858,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.2.3" + "source": "https://github.com/symfony/yaml/tree/v5.2.5" }, "funding": [ { @@ -6864,7 +6874,7 @@ "type": "tidelift" } ], - "time": "2021-02-03T04:42:09+00:00" + "time": "2021-03-06T07:59:01+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Helpers/functions.php b/src/Helpers/functions.php index b49e087..5b1fe90 100644 --- a/src/Helpers/functions.php +++ b/src/Helpers/functions.php @@ -3,14 +3,15 @@ namespace Milebits\Helpers\Helpers; use Illuminate\Database\Eloquent\Model; +use JetBrains\PhpStorm\Pure; if (!function_exists('constExists')) { /** - * @param $class + * @param object|string $class * @param string $constant * @return bool */ - function constExists($class, string $constant) + #[Pure] function constExists(object|string $class, string $constant): bool { if (is_object($class)) $class = get_class($class); return defined(sprintf("%s::%s", $class, $constant)); @@ -22,9 +23,9 @@ function constExists($class, string $constant) * @param object $object * @param string $name * @param null $default - * @return mixed|null + * @return mixed */ - function propVal(object $object, string $name, $default = null) + #[Pure] function propVal(object $object, string $name, $default = null): mixed { if (!property_exists($object, $name)) return $default; return isset($object->{$name}) ? $object->{$name} : $default; @@ -36,9 +37,9 @@ function propVal(object $object, string $name, $default = null) * @param string $class * @param string $name * @param null $default - * @return mixed|null + * @return mixed */ - function staticPropVal(string $class, string $name, $default = null) + #[Pure] function staticPropVal(string $class, string $name, $default = null): mixed { if (!property_exists($class, $name)) return $default; return isset($class::$$name) ? $class::$$name : $default; @@ -50,9 +51,9 @@ function staticPropVal(string $class, string $name, $default = null) * @param $class * @param string $constant * @param null $default - * @return mixed|null + * @return mixed */ - function constVal($class, string $constant, $default = null) + #[Pure] function constVal($class, string $constant, $default = null): mixed { if (!constExists($class, $constant)) return $default; return constant(sprintf("%s::%s", $class, $constant)) ?? $default; @@ -65,7 +66,7 @@ function constVal($class, string $constant, $default = null) * @param string $trait * @return bool */ - function hasTrait($model, string $trait) + function hasTrait(object|string $model, string $trait): bool { if (is_object($model)) $model = get_class($model); return in_array($trait, class_uses_recursive($model), true); @@ -76,13 +77,24 @@ function hasTrait($model, string $trait) /** * @param string|null $repository * @param mixed|Model $user - * @return mixed|null + * @return mixed */ - function society(string $repository = null, Model $user = null) + function society(string $repository = null, Model $user = null): mixed { if (is_null($user)) $user = request()->user(); if (!hasTrait($user->getMorphClass(), "Milebits\\Society\\Concerns\\Sociable")) return null; if (is_null($repository)) return $user->society(); return $user->society()->buildRepository($repository); } +} + +if (!function_exists('array_wrap')) { + /** + * @param $item + * @return array + */ + #[Pure] function array_wrap($item): array + { + return is_array($item) ? $item : [$item]; + } } \ No newline at end of file