From 4c5b7aef4106282b22f257da1205df4aa34947c2 Mon Sep 17 00:00:00 2001 From: farhad Date: Sun, 16 Jan 2022 11:45:24 +0330 Subject: [PATCH 01/19] WIP --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5d02dcd..55946cb 100755 --- a/composer.json +++ b/composer.json @@ -10,10 +10,10 @@ ], "keywords": ["Laravel","Date","Datetime","Jalali", "Shamsi", "Verta"], "require": { - "php": "^7.2.5|^8.0", + "php": "^7.2.5|^8.0|^8.1", "hekmatinasser/notowo": "^1.0", - "illuminate/validation": "^5|^6|^7|^8", - "illuminate/support": "^5|^6|^7|^8" + "illuminate/validation": "^5|^6|^7|^8|9", + "illuminate/support": "^5|^6|^7|^8|9" }, "require-dev" : { "phpunit/phpunit": "7.2.*", From 145ce06288b69e2864e3ab5978182c6d58e7a123 Mon Sep 17 00:00:00 2001 From: farhad Date: Sun, 16 Jan 2022 11:48:15 +0330 Subject: [PATCH 02/19] WIP --- .github/FUNDING.yml | 1 + .github/workflows/php-cs-fixer.yml | 23 +++++++++++++ .github/workflows/run-tests.yml | 54 ++++++++++++++++++++++++++++++ .php_cs.dist.php | 40 ++++++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100755 .github/FUNDING.yml create mode 100755 .github/workflows/php-cs-fixer.yml create mode 100755 .github/workflows/run-tests.yml create mode 100644 .php_cs.dist.php diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100755 index 0000000..fbb0a46 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: hekmatinasser diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100755 index 0000000..f55d1fa --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -0,0 +1,23 @@ +name: Check & fix styling + +on: [push] + +jobs: + php-cs-fixer: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + + - name: Run PHP CS Fixer + uses: docker://oskarstark/php-cs-fixer-ga + with: + args: --config=.php_cs.dist.php --allow-risky=yes + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Fix styling diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100755 index 0000000..b980745 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,54 @@ +name: run-tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + php: [8.1, 8.0, 7.3, 7.4] + laravel: [6.*,8.*,9.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 8.* + testbench: ^6.23 + - laravel: 6.* + testbench: ^4.9 + - laravel: 9.* + testbench: 7.* + + exclude: + - php: 8.1 + laravel: 6.* + - laravel: 9.* + php: 7.3 + - laravel: 9.* + php: 7.4 + + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Setup problem matchers + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction + - name: Execute tests + run: vendor/bin/phpunit diff --git a/.php_cs.dist.php b/.php_cs.dist.php new file mode 100644 index 0000000..8d8a790 --- /dev/null +++ b/.php_cs.dist.php @@ -0,0 +1,40 @@ +in([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + ->name('*.php') + ->notName('*.blade.php') + ->ignoreDotFiles(true) + ->ignoreVCS(true); + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PSR12' => true, + 'array_syntax' => ['syntax' => 'short'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + 'no_unused_imports' => true, + 'not_operator_with_successor_space' => true, + 'trailing_comma_in_multiline' => true, + 'phpdoc_scalar' => true, + 'unary_operator_spaces' => true, + 'binary_operator_spaces' => true, + 'blank_line_before_statement' => [ + 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], + ], + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_var_without_name' => true, + 'class_attributes_separation' => [ + 'elements' => [ + 'method' => 'one', + ], + ], + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + 'keep_multiple_spaces_after_comma' => true, + ], + 'single_trait_insert_per_statement' => true, + ]) + ->setFinder($finder); From 7a0be8a9367e602e8f7c042077a8ede43674f3d4 Mon Sep 17 00:00:00 2001 From: iamfarhad Date: Sun, 16 Jan 2022 08:18:46 +0000 Subject: [PATCH 03/19] Fix styling --- .php-cs-fixer.cache | 1 + src/Facades/Verta.php | 3 +- src/Lang/ar.php | 5 +- src/Lang/az.php | 5 +- src/Lang/en.php | 5 +- src/Lang/fa.php | 5 +- src/Lang/haz.php | 5 +- src/Lang/ku.php | 5 +- src/Lang/ps.php | 5 +- src/Laravel/JalaliValidator.php | 66 +++++++++++++------ src/Laravel/VertaServiceProvider.php | 36 +++++------ src/Traits/Accessor.php | 13 ++-- src/Traits/Boundaries.php | 5 +- src/Traits/Comparison.php | 32 +++++----- src/Traits/Creator.php | 69 ++++++++++---------- src/Traits/Date.php | 5 +- src/Traits/Difference.php | 6 +- src/Traits/Formatting.php | 95 +++++++++++++++------------- src/Traits/Modification.php | 16 ++--- src/Traits/Transformation.php | 33 +++++----- src/Traits/Translator.php | 15 ++--- src/Verta.php | 6 +- src/VertaInterface.php | 42 ++++++------ src/helpers.php | 3 +- tests/AccessTest.php | 9 +-- tests/ComparisionTest.php | 10 +-- tests/CreatorTest.php | 23 ++++--- tests/FormatTest.php | 3 - tests/ModificationTest.php | 2 - 29 files changed, 263 insertions(+), 265 deletions(-) create mode 100644 .php-cs-fixer.cache diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache new file mode 100644 index 0000000..2423cca --- /dev/null +++ b/.php-cs-fixer.cache @@ -0,0 +1 @@ +{"php":"8.1.1","version":"3.5.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Traits\/Translator.php":448542714,"src\/Traits\/Comparison.php":3926327020,"src\/Traits\/Boundaries.php":177542658,"src\/Traits\/Creator.php":1689858777,"src\/Traits\/Formatting.php":113682988,"src\/Traits\/Accessor.php":3672088395,"src\/Traits\/Difference.php":1846129813,"src\/Traits\/Modification.php":1289161807,"src\/Traits\/Transformation.php":2767394386,"src\/Traits\/Date.php":337576065,"src\/VertaInterface.php":2606416261,"src\/Verta.php":1398063567,"src\/Lang\/ps.php":1557833854,"src\/Lang\/en.php":4059164324,"src\/Lang\/haz.php":67156656,"src\/Lang\/ku.php":1336513500,"src\/Lang\/az.php":722372108,"src\/Lang\/fa.php":1662853050,"src\/Lang\/ar.php":1426472215,"src\/helpers.php":2970057840,"src\/Laravel\/VertaServiceProvider.php":3527274115,"src\/Laravel\/JalaliValidator.php":539122976,"src\/Facades\/Verta.php":8857523,"tests\/ComparisionTest.php":1311523399,"tests\/AccessTest.php":434586276,"tests\/CreatorTest.php":4251091983,"tests\/FormatTest.php":1791904145,"tests\/bootstrap.php":2741744302,"tests\/ModificationTest.php":966836384}} \ No newline at end of file diff --git a/src/Facades/Verta.php b/src/Facades/Verta.php index 0c4f546..d12dc46 100644 --- a/src/Facades/Verta.php +++ b/src/Facades/Verta.php @@ -1,4 +1,5 @@ 'شهر', 'yaer' => 'سنة', 'decade' => 'عشر سنوات', - 'century' => 'مئة عام' + 'century' => 'مئة عام', ], 'phrase' => [ 'am' => 'ق ظ', @@ -78,6 +78,5 @@ return [ '2' => 'الصيف', '3' => 'الخريف', '4' => 'شتاء', - ] + ], ]; - diff --git a/src/Lang/az.php b/src/Lang/az.php index 83b069e..9050577 100644 --- a/src/Lang/az.php +++ b/src/Lang/az.php @@ -45,7 +45,7 @@ return [ 'month' => 'ماه', 'yaer' => 'سال', 'decade' => 'دهه', - 'century' => 'قرن' + 'century' => 'قرن', ], 'phrase' => [ 'am' => 'ق ظ', @@ -78,6 +78,5 @@ return [ '2' => 'تابستان', '3' => 'پاییز', '4' => 'زمستان', - ] + ], ]; - diff --git a/src/Lang/en.php b/src/Lang/en.php index 8d0e9b4..8066c8c 100644 --- a/src/Lang/en.php +++ b/src/Lang/en.php @@ -45,7 +45,7 @@ return [ 'month' => 'month', 'yaer' => 'yaer', 'decade' => 'decade', - 'century' => 'century' + 'century' => 'century', ], 'phrase' => [ 'am' => 'am', @@ -78,6 +78,5 @@ return [ '2' => 'summer', '3' => 'autumn', '4' => 'winter', - ] + ], ]; - diff --git a/src/Lang/fa.php b/src/Lang/fa.php index 15dcaad..31a92da 100644 --- a/src/Lang/fa.php +++ b/src/Lang/fa.php @@ -45,7 +45,7 @@ return [ 'month' => 'ماه', 'yaer' => 'سال', 'decade' => 'دهه', - 'century' => 'قرن' + 'century' => 'قرن', ], 'phrase' => [ 'am' => 'ق ظ', @@ -78,6 +78,5 @@ return [ '2' => 'تابستان', '3' => 'پاییز', '4' => 'زمستان', - ] + ], ]; - diff --git a/src/Lang/haz.php b/src/Lang/haz.php index 8d76699..b6c015d 100644 --- a/src/Lang/haz.php +++ b/src/Lang/haz.php @@ -45,7 +45,7 @@ return [ 'month' => 'ماه', 'yaer' => 'سال', 'decade' => 'دهه', - 'century' => 'قرن' + 'century' => 'قرن', ], 'phrase' => [ 'am' => 'ق ظ', @@ -78,6 +78,5 @@ return [ '2' => 'تابستان', '3' => 'پاییز', '4' => 'زمستان', - ] + ], ]; - diff --git a/src/Lang/ku.php b/src/Lang/ku.php index 452c963..49c713f 100644 --- a/src/Lang/ku.php +++ b/src/Lang/ku.php @@ -45,7 +45,7 @@ return [ 'month' => 'ماه', 'yaer' => 'سال', 'decade' => 'دهه', - 'century' => 'قرن' + 'century' => 'قرن', ], 'phrase' => [ 'am' => 'ق ظ', @@ -78,6 +78,5 @@ return [ '2' => 'تابستان', '3' => 'پاییز', '4' => 'زمستان', - ] + ], ]; - diff --git a/src/Lang/ps.php b/src/Lang/ps.php index f5170a9..2639790 100644 --- a/src/Lang/ps.php +++ b/src/Lang/ps.php @@ -44,7 +44,7 @@ return [ 'week' => 'هفته', 'month' => 'ماه', 'yaer' => 'سال', - 'century' => 'قرن' + 'century' => 'قرن', ], 'phrase' => [ 'am' => 'ق ظ', @@ -77,6 +77,5 @@ return [ '2' => 'تابستان', '3' => 'پاییز', '4' => 'زمستان', - ] + ], ]; - diff --git a/src/Laravel/JalaliValidator.php b/src/Laravel/JalaliValidator.php index 49b9a8d..862a506 100644 --- a/src/Laravel/JalaliValidator.php +++ b/src/Laravel/JalaliValidator.php @@ -3,33 +3,35 @@ namespace Hekmatinasser\Verta\Laravel; use Hekmatinasser\Verta\Verta; -use Illuminate\Support\Arr; -use phpDocumentor\Reflection\Types\Static_; class JalaliValidator { public function validateDate($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) ? $parameters[0] : 'Y/m/d'; + try { Verta::parseFormat($format, $value); } catch (\Exception $e) { return false; } + return true; } public function validateDateEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->eq($base); } catch (\Exception $e) { return false; @@ -38,12 +40,14 @@ class JalaliValidator public function validateDateNotEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->ne($base); } catch (\Exception $e) { return false; @@ -52,27 +56,31 @@ class JalaliValidator public function validateDateTime($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) ? $parameters[0] : 'Y/m/d H:i:s'; + try { Verta::parseFormat($format, $value); } catch (\Exception $e) { return false; } + return true; } public function validateDateTimeEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->eq($base); } catch (\Exception $e) { return false; @@ -81,12 +89,14 @@ class JalaliValidator public function validateDateTimeNotEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->ne($base); } catch (\Exception $e) { return false; @@ -95,12 +105,14 @@ class JalaliValidator public function validateDateAfter($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->gt($base); } catch (\Exception $e) { return false; @@ -109,12 +121,14 @@ class JalaliValidator public function validateDateAfterEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->gte($base); } catch (\Exception $e) { return false; @@ -123,12 +137,14 @@ class JalaliValidator public function validateDateTimeAfter($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->gt($base); } catch (\Exception $e) { return false; @@ -137,12 +153,14 @@ class JalaliValidator public function validateDateTimeAfterEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->gte($base); } catch (\Exception $e) { return false; @@ -151,12 +169,14 @@ class JalaliValidator public function validateDateBefore($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->lt($base); } catch (\Exception $e) { return false; @@ -165,12 +185,14 @@ class JalaliValidator public function validateDateBeforeEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->lte($base); } catch (\Exception $e) { return false; @@ -179,12 +201,14 @@ class JalaliValidator public function validateDateTimeBefore($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->lt($base); } catch (\Exception $e) { return false; @@ -193,12 +217,14 @@ class JalaliValidator public function validateDateTimeBeforeEqual($attribute, $value, $parameters) { - if (!is_string($value)) { + if (! is_string($value)) { return false; } $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; + try { $base = count($parameters) > 0 ? Verta::parseFormat($format, $parameters[0]) : null; + return Verta::parseFormat($format, $value)->lte($base); } catch (\Exception $e) { return false; @@ -214,11 +240,12 @@ class JalaliValidator { $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d'; $date = count($parameters) ? $parameters[0] : Verta::instance()->format($format); - if(Verta::getLocale() != 'en') { + if (Verta::getLocale() != 'en') { $en = Verta::getMessages('en'); $to = Verta::getMessages(); $date = str_replace(array_values($en['numbers']), array_values($to['numbers']), $date); } + return str_replace(':date', $date, $message); } @@ -226,11 +253,12 @@ class JalaliValidator { $format = count($parameters) > 1 ? $parameters[1] : 'Y/m/d H:i:s'; $date = count($parameters) ? $parameters[0] : Verta::instance()->format($format); - if(Verta::getLocale() != 'en') { + if (Verta::getLocale() != 'en') { $en = Verta::getMessages('en'); $to = Verta::getMessages(); $date = str_replace(array_values($en['numbers']), array_values($to['numbers']), $date); } + return str_replace(':date', $date, $message); } -} \ No newline at end of file +} diff --git a/src/Laravel/VertaServiceProvider.php b/src/Laravel/VertaServiceProvider.php index 583b393..cf1bc00 100644 --- a/src/Laravel/VertaServiceProvider.php +++ b/src/Laravel/VertaServiceProvider.php @@ -8,63 +8,62 @@ use Illuminate\Support\ServiceProvider; class VertaServiceProvider extends ServiceProvider { - private $rules = [ 'jdate' => [ 'extend' => 'validateDate', - 'replacer' => 'replaceDateOrDatetime' + 'replacer' => 'replaceDateOrDatetime', ], 'jdate_equal' => [ 'extend' => 'validateDateEqual', - 'replacer' => 'replaceDateAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateAfterOrBeforeOrEqual', ], 'jdate_not_equal' => [ 'extend' => 'validateDateNotEqual', - 'replacer' => 'replaceDateAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateAfterOrBeforeOrEqual', ], 'jdatetime' => [ 'extend' => 'validateDateTime', - 'replacer' => 'replaceDateOrDatetime' + 'replacer' => 'replaceDateOrDatetime', ], 'jdatetime_equal' => [ 'extend' => 'validateDateTimeEqual', - 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual', ], 'jdatetime_not_equal' => [ 'extend' => 'validateDateTimeNotEqual', - 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual', ], 'jdate_after' => [ 'extend' => 'validateDateAfter', - 'replacer' => 'replaceDateAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateAfterOrBeforeOrEqual', ], 'jdate_after_equal' => [ 'extend' => 'validateDateAfterEqual', - 'replacer' => 'replaceDateAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateAfterOrBeforeOrEqual', ], 'jdatetime_after' => [ 'extend' => 'validateDateTimeAfter', - 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual', ], 'jdatetime_after_equal' => [ 'extend' => 'validateDateTimeAfterEqual', - 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual', ], 'jdate_before' => [ 'extend' => 'validateDateBefore', - 'replacer' => 'replaceDateAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateAfterOrBeforeOrEqual', ], 'jdate_before_equal' => [ 'extend' => 'validateDateBeforeEqual', - 'replacer' => 'replaceDateAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateAfterOrBeforeOrEqual', ], 'jdatetime_before' => [ 'extend' => 'validateDateTimeBefore', - 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual', ], 'jdatetime_before_equal' => [ 'extend' => 'validateDateTimeBeforeEqual', - 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual' + 'replacer' => 'replaceDateTimeAfterOrBeforeOrEqual', ], ]; @@ -86,11 +85,10 @@ class VertaServiceProvider extends ServiceProvider public function register() { $this->app->bind('verta', function ($app) { - return new Verta; + return new Verta(); }); } - /** * Get the services provided by the provider. * @@ -98,7 +96,7 @@ class VertaServiceProvider extends ServiceProvider */ public function provides() { - return array('verta'); + return ['verta']; } public function loadValidators() @@ -106,9 +104,7 @@ class VertaServiceProvider extends ServiceProvider $className = JalaliValidator::class . '@'; foreach ($this->rules as $name => $methods) { - if (array_key_exists('extend', $methods) || array_key_exists('replacer', $methods)) { - Validator::extend($name, $className . $methods['extend']); Validator::replacer($name, $className . $methods['replacer']); diff --git a/src/Traits/Accessor.php b/src/Traits/Accessor.php index d2cbc0f..81666c8 100644 --- a/src/Traits/Accessor.php +++ b/src/Traits/Accessor.php @@ -1,16 +1,13 @@ 'Y', 'month' => 'n', 'day' => 'j', @@ -35,7 +32,7 @@ trait Accessor 'weekOfYear' => 'W', 'daysInMonth' => 't', 'timestamp' => 'U', - ); + ]; switch (true) { case isset($formats[$name]): @@ -90,15 +87,18 @@ trait Accessor list($year, $month, $day, $hour, $minute, $second) = explode('-', $this->format('Y-n-j-G-i-s')); $$name = $value; $this->setDateTime($year, $month, $day, $hour, $minute, $second); + break; case 'timestamp': $this->setTimestamp($value); + break; case 'timezone': case 'tz': $this->setTimezone(new DateTimeZone($value)); + break; default: @@ -268,5 +268,4 @@ trait Accessor return $this->setTime($hour, $minute, $second, 0); } - -} \ No newline at end of file +} diff --git a/src/Traits/Boundaries.php b/src/Traits/Boundaries.php index e412455..7805207 100644 --- a/src/Traits/Boundaries.php +++ b/src/Traits/Boundaries.php @@ -1,9 +1,7 @@ setDateTime($this->year, 12, $day, 23, 59, 59); } - -} \ No newline at end of file +} diff --git a/src/Traits/Comparison.php b/src/Traits/Comparison.php index 7c82912..a6fc9b6 100644 --- a/src/Traits/Comparison.php +++ b/src/Traits/Comparison.php @@ -1,22 +1,20 @@ 32766) { + public static function isValidDate($year, $month, $day) + { + if ($year < 0 || $year > 32766) { return false; } - if($month < 1 || $month > 12) { + if ($month < 1 || $month > 12) { return false; } - $dayLastMonthJalali = static::isLeapYear($year) && ($month == 12) ? 30 : static::$daysMonthJalali[intval($month)-1]; - if($day < 1 || $day > $dayLastMonthJalali) { + $dayLastMonthJalali = static::isLeapYear($year) && ($month == 12) ? 30 : static::$daysMonthJalali[intval($month) - 1]; + if ($day < 1 || $day > $dayLastMonthJalali) { return false; } + return true; } @@ -49,7 +49,8 @@ trait Comparison * @param int $second * @return bool */ - public static function isValidTime($hour, $minute, $second) { + public static function isValidTime($hour, $minute, $second) + { return $hour >= 0 && $hour <= 23 && $minute >= 0 && $minute <= 59 && $second >= 0 && $second <= 59; @@ -90,7 +91,7 @@ trait Comparison */ public function ne(Verta $v = null) { - return !$this->eq($v); + return ! $this->eq($v); } /** @@ -324,7 +325,7 @@ trait Comparison */ public function isWeekday() { - return !$this->isWeekend(); + return ! $this->isWeekend(); } /** @@ -372,7 +373,7 @@ trait Comparison * * @return bool */ - public function isNextWeek() : bool + public function isNextWeek(): bool { return $this->weekOfYear === static::now($this->getTimezone())->addWeek()->weekOfYear; } @@ -602,5 +603,4 @@ trait Comparison { return $this->dayOfWeek === static::FRIDAY; } - -} \ No newline at end of file +} diff --git a/src/Traits/Creator.php b/src/Traits/Creator.php index defa519..aa03b7e 100644 --- a/src/Traits/Creator.php +++ b/src/Traits/Creator.php @@ -1,6 +1,5 @@ getTimestamp()}"; - } - elseif (is_int($datetime)) { + } elseif (is_int($datetime)) { $datetime = "@$datetime"; } @@ -49,7 +44,8 @@ trait Creator * @param null $timezone * @return static */ - public static function now($timezone = null) { + public static function now($timezone = null) + { return new static(null, $timezone); } @@ -60,7 +56,6 @@ trait Creator * * @return static */ - public static function today($timezone = null) { return (new static($timezone))->startDay(); @@ -98,7 +93,8 @@ trait Creator * * @return static */ - public static function instance($datetime = null, $timezone = null) { + public static function instance($datetime = null, $timezone = null) + { return new static($datetime, $timezone); } @@ -127,7 +123,8 @@ trait Creator * * @return datetime $datetime */ - public function datetime() { + public function datetime() + { return new DateTime(date('Y-m-d H:i:s', $this->getTimestamp()), $this->getTimezone()); } @@ -139,23 +136,28 @@ trait Creator * * @return static */ - public static function parse($datetime , $timezone = null) + public static function parse($datetime, $timezone = null) { self::loadMessages(); - $names = array_map(function ($value) { return " $value "; }, array_values(self::$messages['year_months'])); - $values = array_map(function ($value) { return "-$value-"; }, range(1,12)); + $names = array_map(function ($value) { + return " $value "; + }, array_values(self::$messages['year_months'])); + $values = array_map(function ($value) { + return "-$value-"; + }, range(1, 12)); $formatted = str_replace($names, $values, $datetime); - $formatted = str_replace(array_values(self::$messages['year_months']), range(1,12), $formatted); + $formatted = str_replace(array_values(self::$messages['year_months']), range(1, 12), $formatted); $parse = date_parse($formatted); - if($parse['error_count'] > 0 || !self::isValidDate($parse['year'], $parse['month'], $parse['day']) || !self::isValidTime($parse['hour'], $parse['minute'], $parse['second'])) { + if ($parse['error_count'] > 0 || ! self::isValidDate($parse['year'], $parse['month'], $parse['day']) || ! self::isValidTime($parse['hour'], $parse['minute'], $parse['second'])) { throw new InvalidArgumentException(sprintf("Unknown datetime '%s'", $datetime)); } list($year, $month, $day) = self::getGregorian($parse['year'], $parse['month'], $parse['day']); - list($hour,$minute, $second) = array($parse['hour'], $parse['minute'], $parse['second']); + list($hour, $minute, $second) = [$parse['hour'], $parse['minute'], $parse['second']]; $datetime = sprintf('%04s-%02s-%02s %02s:%02s:%02s', $year, $month, $day, $hour, $minute, $second); + return new static($datetime, $timezone); } @@ -170,16 +172,17 @@ trait Creator public static function parseFormat($format, $datetime, $timezone = null) { self::loadMessages(); - $formatted = str_replace(array_values(self::$messages['year_months']), range(1,12), $datetime); + $formatted = str_replace(array_values(self::$messages['year_months']), range(1, 12), $datetime); $parse = date_parse_from_format($format, $formatted); - if($parse['error_count'] > 0 || !self::isValidDate($parse['year'], $parse['month'], $parse['day']) || !self::isValidTime($parse['hour'], $parse['minute'], $parse['second'])) { + if ($parse['error_count'] > 0 || ! self::isValidDate($parse['year'], $parse['month'], $parse['day']) || ! self::isValidTime($parse['hour'], $parse['minute'], $parse['second'])) { throw new InvalidArgumentException(sprintf("Unknown datetime '%s'", $datetime)); } list($year, $month, $day) = self::getGregorian($parse['year'], $parse['month'], $parse['day']); - list($hour,$minute, $second) = array($parse['hour'], $parse['minute'], $parse['second']); + list($hour, $minute, $second) = [$parse['hour'], $parse['minute'], $parse['second']]; $datetime = sprintf('%04s-%02s-%02s %02s:%02s:%02s', $year, $month, $day, $hour, $minute, $second); + return new static($datetime, $timezone); } @@ -251,14 +254,13 @@ trait Creator * @param null $timezone * @return DateTimeZone|null */ - protected static function createTimeZone($timezone = null) { + protected static function createTimeZone($timezone = null) + { if ($timezone === null) { $tz = new DateTimeZone(date_default_timezone_get()); - } - elseif ($timezone instanceof DateTimeZone) { + } elseif ($timezone instanceof DateTimeZone) { $tz = $timezone; - } - else { + } else { $tz = @timezone_open(strval($timezone)); if ($tz === false) { throw new InvalidArgumentException(sprintf("Unknown timezone '%s'", $tz)); @@ -286,18 +288,17 @@ trait Creator */ public static function createGregorian($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null) { - $now = (new DateTime())->format('Y-n-j-G-i-s'); - $defaults = array_combine(array('year', 'month', 'day', 'hour', 'minute', 'second'), explode('-', $now)); + $defaults = array_combine(['year', 'month', 'day', 'hour', 'minute', 'second'], explode('-', $now)); $year = $year ?? intval($defaults['year']); $month = $month ?? intval($defaults['month']); $day = $day ?? intval($defaults['day']); $hour = $hour ?? intval($defaults['hour']); $minute = $minute ?? intval($defaults['minute']); - $second = $second ?? intval($defaults['second']); + $second = $second ?? intval($defaults['second']); - if (!checkdate($month, $day, $year) || !static::isValidTime($hour, $minute, $second)) { + if (! checkdate($month, $day, $year) || ! static::isValidTime($hour, $minute, $second)) { throw new \InvalidArgumentException('Unknown datetime'); } @@ -350,11 +351,10 @@ trait Creator * * @return static */ - public static function createJalali($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null) { $now = (new static())->format('Y-n-j-G-i-s'); - $defaults = array_combine(array('year', 'month', 'day', 'hour', 'minute', 'second'), explode('-', $now)); + $defaults = array_combine(['year', 'month', 'day', 'hour', 'minute', 'second'], explode('-', $now)); $year = $year ?? intval($defaults['year']); $month = $month ?? intval($defaults['month']); @@ -363,7 +363,7 @@ trait Creator $minute = $minute ?? intval($defaults['minute']); $second = $second ?? intval($defaults['second']); - if (!static::isValidDate($year, $month, $day) || !static::isValidTime($hour, $minute, $second)) { + if (! static::isValidDate($year, $month, $day) || ! static::isValidTime($hour, $minute, $second)) { throw new \InvalidArgumentException('Unknown datetime'); } @@ -399,5 +399,4 @@ trait Creator { return static::createJalali(null, null, null, $hour, $minute, $second, $timezone); } - } diff --git a/src/Traits/Date.php b/src/Traits/Date.php index 44306b3..1d72a61 100644 --- a/src/Traits/Date.php +++ b/src/Traits/Date.php @@ -1,9 +1,7 @@ getTimestamp() - $this->getTimestamp(); } - -} \ No newline at end of file +} diff --git a/src/Traits/Formatting.php b/src/Traits/Formatting.php index 96840de..cf663e0 100644 --- a/src/Traits/Formatting.php +++ b/src/Traits/Formatting.php @@ -1,15 +1,12 @@ getTimestamp(); - list( $gYear, $gMonth, $gDay, $gWeek ) = explode( '-', parent::format('Y-m-d-w')); - list( $pYear, $pMonth, $pDay ) = static::getJalali( $gYear, $gMonth, $gDay ); + list($gYear, $gMonth, $gDay, $gWeek) = explode('-', parent::format('Y-m-d-w')); + list($pYear, $pMonth, $pDay) = static::getJalali($gYear, $gMonth, $gDay); $pWeek = $gWeek + 1; @@ -62,29 +59,30 @@ trait Formatting $result = ''; while ($index < $lengh) { - $char = $format[$index]; + $char = $format[$index]; if ($char == '\\') { $result .= $format[++$index]; $index++; + continue; } $result .= $this->characterFormat($char, $timestamp, $pYear, $pMonth, $pDay, $pWeek); $index++; } + return $result; } - /** * The format of the outputted date charactre (jalali equivalent of php date() function) * * @param string $char - * @param integer $timestamp - * @param integer $pYear - * @param integer $pMonth - * @param integer $pDay - * @param integer $pWeek + * @param int $timestamp + * @param int $pYear + * @param int $pMonth + * @param int $pDay + * @param int $pWeek * @return string */ private function characterFormat($char, $timestamp, $pYear, $pMonth, $pDay, $pWeek) @@ -92,62 +90,62 @@ trait Formatting switch ($char) { # Day case 'd': - return sprintf( '%02s', $pDay ); + return sprintf('%02s', $pDay); case 'D': - return substr( self::$messages['weekdays'][$pWeek+1], 0, 2 ); + return substr(self::$messages['weekdays'][$pWeek + 1], 0, 2); case 'j': return $pDay; case 'l': - return self::$messages['weekdays'][$pWeek+1]; + return self::$messages['weekdays'][$pWeek + 1]; case 'N': - return $pWeek+1; + return $pWeek + 1; case 'w': return $pWeek; case 'z': - return $this->daysYear( $pMonth, $pDay ); + return $this->daysYear($pMonth, $pDay); case 'S': return static::$messages['phrase']['th']; # Week case 'W': - return ceil( $this->daysYear( $pMonth, $pDay ) / 7 ); + return ceil($this->daysYear($pMonth, $pDay) / 7); # Month case 'F': return self::$messages['year_months'][$pMonth]; case 'm': - return sprintf( '%02s', $pMonth ); + return sprintf('%02s', $pMonth); case 'M': - return substr(self::$messages['year_months'][$pMonth], 0, 6 ); + return substr(self::$messages['year_months'][$pMonth], 0, 6); case 'n': return $pMonth; case 't': - return static::isLeapYear( $pYear ) && ( $pMonth == 12 ) ? 30 : static::$daysMonthJalali[ intval( $pMonth ) - 1 ]; + return static::isLeapYear($pYear) && ($pMonth == 12) ? 30 : static::$daysMonthJalali[ intval($pMonth) - 1 ]; # Quarter case 'Q': case 'q': return self::$messages['quarters'][$this->quarter]; # Years case 'L': - return intval( $this->isLeapYear( $pYear ) ); + return intval($this->isLeapYear($pYear)); case 'Y': case 'o': return $pYear; case 'y': - return substr( $pYear, 2 ); + return substr($pYear, 2); # Time case 'a': @@ -171,14 +169,14 @@ trait Formatting case 'P': case 'T': case 'Z': - return parent::format( $char ); + return parent::format($char); # Full Date/Time case 'c': - return ( $pYear . '-' . $pMonth . '-' . $pDay . ' ' . parent::format( 'H:i:s P' ) ); + return ($pYear . '-' . $pMonth . '-' . $pDay . ' ' . parent::format('H:i:s P')); case 'r': - return ( substr(self::$messages['weekdays'][$pWeek], 0, 2 ) . '، ' . $pDay . ' ' . substr(self::$messages['year_months'][$pMonth], 0, 6 ) . ' ' . $pYear . ' ' . parent::format( 'H:i:s P' ) ); + return (substr(self::$messages['weekdays'][$pWeek], 0, 2) . '، ' . $pDay . ' ' . substr(self::$messages['year_months'][$pMonth], 0, 6) . ' ' . $pYear . ' ' . parent::format('H:i:s P')); case 'U': return $timestamp; @@ -194,12 +192,12 @@ trait Formatting * @param string $format for example 'Y-m-d H:i:s' * @return string */ - protected function dateWord($format){ - + protected function dateWord($format) + { $timestamp = $this->getTimestamp(); - list( $gYear, $gMonth, $gDay, $gWeek ) = explode( '-', parent::format('Y-m-d-w')); - list( $pYear, $pMonth, $pDay ) = static::getJalali( $gYear, $gMonth, $gDay ); + list($gYear, $gMonth, $gDay, $gWeek) = explode('-', parent::format('Y-m-d-w')); + list($pYear, $pMonth, $pDay) = static::getJalali($gYear, $gMonth, $gDay); $pWeek = $gWeek + 1; @@ -212,20 +210,22 @@ trait Formatting $result = ''; while ($index < $lengh) { - $char = $format[$index]; + $char = $format[$index]; if ($char == '\\') { $result .= $format[++$index]; $index++; + continue; } $output = $this->characterFormat($char, $timestamp, $pYear, $pMonth, $pDay, $pWeek); - if(is_numeric($output)) { - $output = (string) new Notowo($output, static::getLocale() == 'en' ? 'en' : 'fa' ); + if (is_numeric($output)) { + $output = (string) new Notowo($output, static::getLocale() == 'en' ? 'en' : 'fa'); } $result .= $output; $index++; } + return $result; } @@ -237,11 +237,13 @@ trait Formatting * @return type * @since 5.0.0 */ - protected function daysYear($month, $day) { + protected function daysYear($month, $day) + { $days = 0; - for ($i = 1; $i < $month; $i ++) { - $days += static::$daysMonthJalali[$i-1]; + for ($i = 1; $i < $month; $i++) { + $days += static::$daysMonthJalali[$i - 1]; } + return ($days + $day); } @@ -253,7 +255,7 @@ trait Formatting */ protected function strftime($format) { - $strftime_date = array( + $strftime_date = [ "%a" => "D", "%A" => "l", "%d" => "d", @@ -295,8 +297,8 @@ trait Formatting "%t" => "\t", "%%" => "%", "%Q" => "q", - "%q" => "q" - ); + "%q" => "q", + ]; return str_replace(array_keys($strftime_date), array_values($strftime_date), $format); } @@ -307,7 +309,8 @@ trait Formatting * @param $format * @return string */ - public function format($format) { + public function format($format) + { return $this->date($this->strftime($format)); } @@ -317,8 +320,8 @@ trait Formatting * @param $format * @return string */ - public function formatGregorian($format) { - + public function formatGregorian($format) + { return $this->datetime()->format($format); } @@ -401,7 +404,7 @@ trait Formatting } $difference = intval(round($difference)); - if($difference === 0) { + if ($difference === 0) { return static::$messages['phrase']['now']; } @@ -423,6 +426,7 @@ trait Formatting { $en = static::getMessages('en'); $fa = static::getMessages('fa'); + return str_replace(array_values($en['numbers']), array_values($fa['numbers']), $string); } @@ -436,6 +440,7 @@ trait Formatting { $fa = static::getMessages('fa'); $en = static::getMessages('en'); + return str_replace(array_values($fa['numbers']), array_values($en['numbers']), $string); } @@ -449,7 +454,7 @@ trait Formatting { $ar = static::getMessages('ar'); $en = static::getMessages('en'); + return str_replace(array_values($ar['numbers']), array_values($en['numbers']), $string); } - -} \ No newline at end of file +} diff --git a/src/Traits/Modification.php b/src/Traits/Modification.php index afbd866..7ad60db 100644 --- a/src/Traits/Modification.php +++ b/src/Traits/Modification.php @@ -1,14 +1,9 @@ 12) { $year += intval($month / 12); $month = $month % 12; - } - elseif ($month < 1) { + } elseif ($month < 1) { $year += intval($month / 12) - 1; $month = 12 + ($month % 12); } - if($month == 0) { + if ($month == 0) { $year--; $month = 12; } if (($month > 6 && $month < 12 && $day == 31)) { $day--; - } - else { + } else { if ($month == 12 && ($day == 30 || $day == 31)) { $day = self::isLeapYear($year) ? 30 : 29; } } + return self::createJalali($year, $month, $day, $hour, $minute, $second, $this->getTimeZone()); } @@ -373,4 +367,4 @@ trait Modification { return $this->addSeconds(-1 * $value); } -} \ No newline at end of file +} diff --git a/src/Traits/Transformation.php b/src/Traits/Transformation.php index db1b50c..98fcf45 100644 --- a/src/Traits/Transformation.php +++ b/src/Traits/Transformation.php @@ -1,12 +1,9 @@ 1 && (($gy % 4 == 0 && $gy % 100 != 0) || ($gy % 400 == 0))) + if ($gm > 1 && (($gy % 4 == 0 && $gy % 100 != 0) || ($gy % 400 == 0))) { # leap and after Feb - $g_day_no ++; + $g_day_no++; + } $g_day_no += $g_d - 1; $j_day_no = $g_day_no - 79; $j_np = static::div($j_day_no, 12053); # 12053 = (365 * 33 + 32 / 4) @@ -38,7 +37,8 @@ trait Transformation for ($i = 0; ($i < 11 && $j_day_no >= static::$daysMonthJalali[$i]); ++$i) { $j_day_no -= static::$daysMonthJalali[$i]; } - return array($jy, $i + 1, $j_day_no + 1); + + return [$jy, $i + 1, $j_day_no + 1]; } /** @@ -49,7 +49,8 @@ trait Transformation * @param int $j_d * @return array */ - public static function getGregorian($j_y, $j_m, $j_d) { + public static function getGregorian($j_y, $j_m, $j_d) + { $jy = $j_y - 979; $jm = $j_m - 1; $j_day_no = (365 * $jy + static::div($jy, 33) * 8 + static::div($jy % 33 + 3, 4)); @@ -62,11 +63,11 @@ trait Transformation $g_day_no = $g_day_no % 146097; $leap = 1; if ($g_day_no >= 36525) { # 36525 = (365 * 100 + 100 / 4) - $g_day_no --; + $g_day_no--; $gy += (100 * static::div($g_day_no, 36524)); # 36524 = (365 * 100 + 100 / 4 - 100 / 100) $g_day_no = $g_day_no % 36524; if ($g_day_no >= 365) { - $g_day_no ++; + $g_day_no++; } else { $leap = 0; } @@ -75,14 +76,15 @@ trait Transformation $g_day_no %= 1461; if ($g_day_no >= 366) { $leap = 0; - $g_day_no --; + $g_day_no--; $gy += static::div($g_day_no, 365); $g_day_no = ($g_day_no % 365); } - for ($i = 0; $g_day_no >= (static::$daysMonthGregorian[$i] + ($i == 1 && $leap)); $i ++) { + for ($i = 0; $g_day_no >= (static::$daysMonthGregorian[$i] + ($i == 1 && $leap)); $i++) { $g_day_no -= (static::$daysMonthGregorian[$i] + ($i == 1 && $leap)); } - return array($gy, $i + 1, $g_day_no + 1); + + return [$gy, $i + 1, $g_day_no + 1]; } /** @@ -92,7 +94,8 @@ trait Transformation * @param int $b * @return int */ - private static function div($a, $b) { + private static function div($a, $b) + { return ~~($a / $b); } -} \ No newline at end of file +} diff --git a/src/Traits/Translator.php b/src/Traits/Translator.php index 52f624a..f01b68f 100644 --- a/src/Traits/Translator.php +++ b/src/Traits/Translator.php @@ -1,9 +1,7 @@ assertEquals('Asia/Tehran', $datetime->timezone); } - public function testSetDateTime() { - $datetime = verta()->setDateTime(1397,10,11,10,20,11); + $datetime = verta()->setDateTime(1397, 10, 11, 10, 20, 11); $this->assertEquals(1397, $datetime->year); $this->assertEquals(10, $datetime->month); @@ -98,10 +97,9 @@ class AccessTest extends TestCase $this->assertEquals(11, $datetime->second); } - public function testSetDate() { - $datetime = verta()->setDate(1397,10,11); + $datetime = verta()->setDate(1397, 10, 11); $this->assertEquals(1397, $datetime->year); $this->assertEquals(10, $datetime->month); @@ -110,7 +108,7 @@ class AccessTest extends TestCase public function testSetTime() { - $datetime = verta()->setTime(10,20,11); + $datetime = verta()->setTime(10, 20, 11); $this->assertEquals(10, $datetime->hour); $this->assertEquals(20, $datetime->minute); @@ -124,6 +122,5 @@ class AccessTest extends TestCase $this->assertEquals(10, $datetime->hour); $this->assertEquals(20, $datetime->minute); $this->assertEquals(11, $datetime->second); - } } diff --git a/tests/ComparisionTest.php b/tests/ComparisionTest.php index 6155d68..9324798 100644 --- a/tests/ComparisionTest.php +++ b/tests/ComparisionTest.php @@ -190,13 +190,13 @@ class ComparisionTest extends TestCase { $datetime = Verta::parse('1398-10-10 21:30:50'); - $result = $datetime->between(Verta::parse('1398-10-10 21:30:50'), Verta::parse('1398-10-11 21:30:50')); + $result = $datetime->between(Verta::parse('1398-10-10 21:30:50'), Verta::parse('1398-10-11 21:30:50')); $this->assertTrue($result); - $result = $datetime->between(Verta::parse('1398-10-10 21:30:50'), Verta::parse('1398-10-11 21:30:50'), false); + $result = $datetime->between(Verta::parse('1398-10-10 21:30:50'), Verta::parse('1398-10-11 21:30:50'), false); $this->assertFalse($result); - $result = $datetime->between(Verta::parse('1398-10-13 21:30:50'), Verta::parse('1398-10-09 21:30:50')); + $result = $datetime->between(Verta::parse('1398-10-13 21:30:50'), Verta::parse('1398-10-09 21:30:50')); $this->assertTrue($result); } @@ -204,10 +204,10 @@ class ComparisionTest extends TestCase { $datetime = Verta::parse('1398-10-10 21:30:50'); - $result = $datetime->closest(Verta::parse('1398-10-10 21:30:01'), Verta::parse('1398-10-11 21:30:50')); + $result = $datetime->closest(Verta::parse('1398-10-10 21:30:01'), Verta::parse('1398-10-11 21:30:50')); $this->assertEquals($result, Verta::parse('1398-10-10 21:30:01')); - $result = $datetime->closest(Verta::parse('1398-11-10 21:30:50'), Verta::parse('1398-10-11 21:30:50')); + $result = $datetime->closest(Verta::parse('1398-11-10 21:30:50'), Verta::parse('1398-10-11 21:30:50')); $this->assertEquals($result, Verta::parse('1398-10-11 21:30:50')); } diff --git a/tests/CreatorTest.php b/tests/CreatorTest.php index 0b3d8e4..e91666f 100644 --- a/tests/CreatorTest.php +++ b/tests/CreatorTest.php @@ -23,7 +23,6 @@ class CreatorTest extends TestCase $actual = verta()->getTimestamp(); $this->assertEquals($expected, $actual); - } public function testYesterday() @@ -60,7 +59,7 @@ class CreatorTest extends TestCase $datetime = (string) Verta::instance('2019-01-01 10:20:11'); $this->assertEquals('1397-10-11 10:20:11', $datetime); - $app = ['verta' => new Verta]; + $app = ['verta' => new Verta()]; VertaFacade::setFacadeApplication($app); $datetime = (string) VertaFacade::instance('2019-01-01 10:20:11'); @@ -84,14 +83,14 @@ class CreatorTest extends TestCase public function testParseFormat() { - $datetime = Verta::parseFormat('Y-m-d H:i:s','1397-10-11 10:20:11')->formatGregorian('Y-m-d H:i:s'); + $datetime = Verta::parseFormat('Y-m-d H:i:s', '1397-10-11 10:20:11')->formatGregorian('Y-m-d H:i:s'); $this->assertEquals('2019-01-01 10:20:11', $datetime); } public function testCreate() { - $datetime = Verta::create(2019,1,1,10,20,11)->format('Y-m-d H:i:s'); + $datetime = Verta::create(2019, 1, 1, 10, 20, 11)->format('Y-m-d H:i:s'); $this->assertEquals('1397-10-11 10:20:11', $datetime); } @@ -99,7 +98,7 @@ class CreatorTest extends TestCase public function testCreateDate() { $time = (new DateTime())->format("H:i:s"); - $datetime = Verta::createDate(2019,1,1)->format('Y-m-d H:i:s'); + $datetime = Verta::createDate(2019, 1, 1)->format('Y-m-d H:i:s'); $this->assertEquals("1397-10-11 {$time}", $datetime); } @@ -107,7 +106,7 @@ class CreatorTest extends TestCase public function testCreateTime() { $date = (new DateTime())->format("Y-m-d"); - $datetime = Verta::createTime(15,19,51)->formatGregorian('Y-m-d H:i:s'); + $datetime = Verta::createTime(15, 19, 51)->formatGregorian('Y-m-d H:i:s'); $this->assertEquals("{$date} 15:19:51", $datetime); } @@ -121,7 +120,7 @@ class CreatorTest extends TestCase public function testCreateGregorian() { - $datetime = Verta::create(2019,1,1,10,20,11)->format('Y-m-d H:i:s'); + $datetime = Verta::create(2019, 1, 1, 10, 20, 11)->format('Y-m-d H:i:s'); $this->assertEquals('1397-10-11 10:20:11', $datetime); } @@ -129,7 +128,7 @@ class CreatorTest extends TestCase public function testCreateGregorianDate() { $time = (new DateTime())->format("H:i:s"); - $datetime = Verta::createGregorianDate(2019,1,1)->format('Y-m-d H:i:s'); + $datetime = Verta::createGregorianDate(2019, 1, 1)->format('Y-m-d H:i:s'); $this->assertEquals("1397-10-11 {$time}", $datetime); } @@ -137,14 +136,14 @@ class CreatorTest extends TestCase public function testCreateGregorianTime() { $date = (new DateTime())->format("Y-m-d"); - $datetime = Verta::createGregorianTime(15,19,51)->formatGregorian('Y-m-d H:i:s'); + $datetime = Verta::createGregorianTime(15, 19, 51)->formatGregorian('Y-m-d H:i:s'); $this->assertEquals("{$date} 15:19:51", $datetime); } public function testCreateJalali() { - $datetime = Verta::createJalali(1397,10,11,10,20,11)->format('Y-m-d H:i:s'); + $datetime = Verta::createJalali(1397, 10, 11, 10, 20, 11)->format('Y-m-d H:i:s'); $this->assertEquals('1397-10-11 10:20:11', $datetime); } @@ -152,7 +151,7 @@ class CreatorTest extends TestCase public function testCreateJalaliDate() { $time = (new DateTime())->format("H:i:s"); - $datetime = Verta::createJalaliDate(1397,10,11)->format('Y-m-d H:i:s'); + $datetime = Verta::createJalaliDate(1397, 10, 11)->format('Y-m-d H:i:s'); $this->assertEquals("1397-10-11 {$time}", $datetime); } @@ -160,7 +159,7 @@ class CreatorTest extends TestCase public function testCreateJalaliTime() { $date = verta()->format("Y-m-d"); - $datetime = Verta::createJalaliTime(15,19,51)->format('Y-m-d H:i:s'); + $datetime = Verta::createJalaliTime(15, 19, 51)->format('Y-m-d H:i:s'); $this->assertEquals("{$date} 15:19:51", $datetime); } diff --git a/tests/FormatTest.php b/tests/FormatTest.php index 81ed3fd..b945f58 100644 --- a/tests/FormatTest.php +++ b/tests/FormatTest.php @@ -2,7 +2,6 @@ namespace Hekmatinasser\Verta\Tests; -use DateTime; use Hekmatinasser\Verta\Verta; use PHPUnit\Framework\TestCase; @@ -20,7 +19,6 @@ class FormatTest extends TestCase $datetime = (string) Verta::parse('1398-10-10 22:30:50'); $this->assertEquals('1398-10-10 22:30:50', $datetime); - } public function testFormat() @@ -111,7 +109,6 @@ class FormatTest extends TestCase $difference = $target->formatDifference($datetime); $this->assertEquals('1 سال بعد', $difference); - } public function testFormatWord() diff --git a/tests/ModificationTest.php b/tests/ModificationTest.php index 56e6748..28c4032 100644 --- a/tests/ModificationTest.php +++ b/tests/ModificationTest.php @@ -222,6 +222,4 @@ class ModificationTest extends TestCase $this->assertEquals('1398-12-29 23:59:59', $result); } - - } From 2ee42c77405747555fde55ba5aa20f50d1c5a786 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 11:50:32 +0330 Subject: [PATCH 04/19] WIP --- .travis.yml | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 899e5c2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -language: php - -sudo: true - -matrix: - include: - - php: 7.2 - env: LARAVEL_VERSION=5.1.* - - php: 7.2 - env: LARAVEL_VERSION=5.3.* - - php: 7.2 - env: LARAVEL_VERSION=5.5.* - - php: 7.2 - env: LARAVEL_VERSION=5.6.* - - php: 7.2 - env: LARAVEL_VERSION=5.7.* - - php: 7.2 - env: LARAVEL_VERSION=5.7.* - - php: 7.3 - env: LARAVEL_VERSION=5.7.* - - php: 7.2 - env: LARAVEL_VERSION=5.8.* - - php: 7.3 - env: LARAVEL_VERSION=5.8.* - -before_install: - - composer self-update --stable -n - -install: - - travis_retry composer install --no-suggest - -script: - - vendor/bin/phpunit --coverage-clover clover.xml; - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar; - - php ocular.phar code-coverage:upload --format=php-clover clover.xml; - - bash <(curl -s https://codecov.io/bash) From dbee9764a29cf88d19fb0b0e61bd121bd883a673 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 11:52:30 +0330 Subject: [PATCH 05/19] WIP --- composer.json | 3 +- composer.lock | 2830 ------------------------------------------------- 2 files changed, 2 insertions(+), 2831 deletions(-) delete mode 100644 composer.lock diff --git a/composer.json b/composer.json index 55946cb..ddda496 100755 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ "illuminate/support": "^5|^6|^7|^8|9" }, "require-dev" : { - "phpunit/phpunit": "7.2.*", + "orchestra/testbench": "^4.9|^6.23|^7.0", + "phpunit/phpunit": "^9.4", "mockery/mockery": "^1.0" }, "autoload": { diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 6cb686e..0000000 --- a/composer.lock +++ /dev/null @@ -1,2830 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "d4bde7d3164c574fd7d74b55078df006", - "packages": [ - { - "name": "doctrine/inflector", - "version": "1.3.x-dev", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "45d9b132b262c1d03835cdeefd42938d881556fa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/45d9b132b262c1d03835cdeefd42938d881556fa", - "reference": "45d9b132b262c1d03835cdeefd42938d881556fa", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ], - "time": "2018-06-15T19:03:38+00:00" - }, - { - "name": "doctrine/lexer", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "6c4b4c3432406c73a4979b7e56efbffb0462ef64" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/6c4b4c3432406c73a4979b7e56efbffb0462ef64", - "reference": "6c4b4c3432406c73a4979b7e56efbffb0462ef64", - "shasum": "" - }, - "require": { - "php": "^7.2" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "time": "2019-07-30T19:38:35+00:00" - }, - { - "name": "egulias/email-validator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/92dd169c32f6f55ba570c309d83f5209cefb5e23", - "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^1.0.1", - "php": ">= 5.5" - }, - "require-dev": { - "dominicsayers/isemail": "dev-master", - "phpunit/phpunit": "^4.8.35||^5.7||^6.0", - "satooshi/php-coveralls": "^1.0.1", - "symfony/phpunit-bridge": "^4.4@dev" - }, - "suggest": { - "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Egulias\\EmailValidator\\": "EmailValidator" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eduardo Gulias Davis" - } - ], - "description": "A library for validating emails against several RFCs", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": [ - "email", - "emailvalidation", - "emailvalidator", - "validation", - "validator" - ], - "time": "2019-08-13T17:33:27+00:00" - }, - { - "name": "hekmatinasser/notowo", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/hekmatinasser/notowo.git", - "reference": "c51ad5dcedac966dd93ce558ac7e6a84e0020d6d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hekmatinasser/notowo/zipball/c51ad5dcedac966dd93ce558ac7e6a84e0020d6d", - "reference": "c51ad5dcedac966dd93ce558ac7e6a84e0020d6d", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Hekmatinasser\\Notowo\\": "src" - }, - "files": [ - "src/helpers.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nasser Hekmati", - "email": "hekmati.nasser@gmail.com" - } - ], - "description": "This Package helps developers change number to word for all language on Laravel freamwork PHP", - "keywords": [ - "Notowo", - "laravel", - "n2w", - "number", - "word" - ], - "time": "2017-09-22T13:41:16+00:00" - }, - { - "name": "illuminate/container", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/container.git", - "reference": "b42e5ef939144b77f78130918da0ce2d9ee16574" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/b42e5ef939144b77f78130918da0ce2d9ee16574", - "reference": "b42e5ef939144b77f78130918da0ce2d9ee16574", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "psr/container": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Container\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Container package.", - "homepage": "https://laravel.com", - "time": "2019-08-20T02:00:23+00:00" - }, - { - "name": "illuminate/contracts", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "00fc6afee788fa07c311b0650ad276585f8aef96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/00fc6afee788fa07c311b0650ad276585f8aef96", - "reference": "00fc6afee788fa07c311b0650ad276585f8aef96", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Contracts\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Contracts package.", - "homepage": "https://laravel.com", - "time": "2019-07-30T13:57:21+00:00" - }, - { - "name": "illuminate/filesystem", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/filesystem.git", - "reference": "494ba903402d64ec49c8d869ab61791db34b2288" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/494ba903402d64ec49c8d869ab61791db34b2288", - "reference": "494ba903402d64ec49c8d869ab61791db34b2288", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "symfony/finder": "^4.2" - }, - "suggest": { - "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", - "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", - "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (^1.0).", - "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Filesystem package.", - "homepage": "https://laravel.com", - "time": "2019-08-14T13:38:15+00:00" - }, - { - "name": "illuminate/support", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "7aabcab4634a1c7865fa6acb6b1b810cf4b699ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/7aabcab4634a1c7865fa6acb6b1b810cf4b699ea", - "reference": "7aabcab4634a1c7865fa6acb6b1b810cf4b699ea", - "shasum": "" - }, - "require": { - "doctrine/inflector": "^1.1", - "ext-json": "*", - "ext-mbstring": "*", - "illuminate/contracts": "5.8.*", - "nesbot/carbon": "^1.26.3 || ^2.0", - "php": "^7.1.3" - }, - "conflict": { - "tightenco/collect": "<5.5.33" - }, - "suggest": { - "illuminate/filesystem": "Required to use the composer class (5.8.*).", - "moontoast/math": "Required to use ordered UUIDs (^1.1).", - "ramsey/uuid": "Required to use Str::uuid() (^3.7).", - "symfony/process": "Required to use the composer class (^4.2).", - "symfony/var-dumper": "Required to use the dd function (^4.2).", - "vlucas/phpdotenv": "Required to use the env helper (^3.3)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, - "files": [ - "helpers.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Support package.", - "homepage": "https://laravel.com", - "time": "2019-08-11T12:48:29+00:00" - }, - { - "name": "illuminate/translation", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/translation.git", - "reference": "a23986a9ae77013046426bbeb4fe9a29e2527f76" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/translation/zipball/a23986a9ae77013046426bbeb4fe9a29e2527f76", - "reference": "a23986a9ae77013046426bbeb4fe9a29e2527f76", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/contracts": "5.8.*", - "illuminate/filesystem": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Translation package.", - "homepage": "https://laravel.com", - "time": "2019-06-04T14:33:55+00:00" - }, - { - "name": "illuminate/validation", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/validation.git", - "reference": "9f0c04d5cbe39fcafc0f3c56c1bba7c681a8ff92" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/validation/zipball/9f0c04d5cbe39fcafc0f3c56c1bba7c681a8ff92", - "reference": "9f0c04d5cbe39fcafc0f3c56c1bba7c681a8ff92", - "shasum": "" - }, - "require": { - "egulias/email-validator": "^2.0", - "ext-json": "*", - "illuminate/container": "5.8.*", - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "illuminate/translation": "5.8.*", - "php": "^7.1.3", - "symfony/http-foundation": "^4.2" - }, - "suggest": { - "illuminate/database": "Required to use the database presence verifier (5.8.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Validation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Validation package.", - "homepage": "https://laravel.com", - "time": "2019-08-15T16:21:14+00:00" - }, - { - "name": "nesbot/carbon", - "version": "2.23.1", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "767617a047e5b8b8b3b0b6023a2650847ed7df02" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/767617a047e5b8b8b3b0b6023a2650847ed7df02", - "reference": "767617a047e5b8b8b3b0b6023a2650847ed7df02", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.1.8 || ^8.0", - "symfony/translation": "^3.4 || ^4.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", - "kylekatarnls/multi-tester": "^1.1", - "phpmd/phpmd": "dev-php-7.1-compatibility", - "phpstan/phpstan": "^0.11", - "phpunit/phpunit": "^7.5 || ^8.0", - "squizlabs/php_codesniffer": "^3.4" - }, - "bin": [ - "bin/carbon" - ], - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Carbon\\": "src/Carbon/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - }, - { - "name": "kylekatarnls", - "homepage": "http://github.com/kylekatarnls" - } - ], - "description": "A API extension for DateTime that supports 281 different languages.", - "homepage": "http://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ], - "time": "2019-08-17T13:57:34+00:00" - }, - { - "name": "psr/container", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "014d250daebff39eba15ba990eeb2a140798e77c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/014d250daebff39eba15ba990eeb2a140798e77c", - "reference": "014d250daebff39eba15ba990eeb2a140798e77c", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2018-12-29T15:36:03+00:00" - }, - { - "name": "psr/simple-cache", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "time": "2017-10-23T01:57:42+00:00" - }, - { - "name": "symfony/finder", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "471f0ff0e1d6bff1f02a0aa5a7ce3f7d5e5c4834" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/471f0ff0e1d6bff1f02a0aa5a7ce3f7d5e5c4834", - "reference": "471f0ff0e1d6bff1f02a0aa5a7ce3f7d5e5c4834", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2019-08-21T15:14:41+00:00" - }, - { - "name": "symfony/http-foundation", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "491b8349828ffde8ecceb871528289cd2033cc26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/491b8349828ffde8ecceb871528289cd2033cc26", - "reference": "491b8349828ffde8ecceb871528289cd2033cc26", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/mime": "^4.3|^5.0", - "symfony/polyfill-mbstring": "~1.1" - }, - "require-dev": { - "predis/predis": "~1.0", - "symfony/expression-language": "^3.4|^4.0|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com", - "time": "2019-08-21T15:14:41+00:00" - }, - { - "name": "symfony/mime", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/mime.git", - "reference": "00a7dc3d5be01ad1e14ebb6393f09545d75d30cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/00a7dc3d5be01ad1e14ebb6393f09545d75d30cc", - "reference": "00a7dc3d5be01ad1e14ebb6393f09545d75d30cc", - "shasum": "" - }, - "require": { - "php": "^7.2.9", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" - }, - "conflict": { - "symfony/mailer": "<4.4" - }, - "require-dev": { - "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "^4.4|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Mime\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A library to manipulate MIME messages", - "homepage": "https://symfony.com", - "keywords": [ - "mime", - "mime-type" - ], - "time": "2019-08-22T08:40:55+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6af626ae6fa37d396dc90a399c0ff08e5cfc45b2", - "reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.9" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "time": "2019-08-06T08:03:45+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2019-08-06T08:03:45+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "04ce3335667451138df4307d6a9b61565560199e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", - "reference": "04ce3335667451138df4307d6a9b61565560199e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2019-08-06T08:03:45+00:00" - }, - { - "name": "symfony/translation", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "1d96e7f97b7e705c51a0e55001a547ed94f555c8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/1d96e7f97b7e705c51a0e55001a547ed94f555c8", - "reference": "1d96e7f97b7e705c51a0e55001a547ed94f555c8", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^1.1.6" - }, - "conflict": { - "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "symfony/translation-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/console": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/finder": "~2.8|~3.0|~4.0|^5.0", - "symfony/http-kernel": "^3.4|^4.0|^5.0", - "symfony/intl": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1.2", - "symfony/var-dumper": "^3.4|^4.0|^5.0", - "symfony/yaml": "^3.4|^4.0|^5.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2019-08-21T15:14:41+00:00" - }, - { - "name": "symfony/translation-contracts", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "325b17c24f3ee23cbecfa63ba809c6d89b5fa04a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/325b17c24f3ee23cbecfa63ba809c6d89b5fa04a", - "reference": "325b17c24f3ee23cbecfa63ba809c6d89b5fa04a", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to translation", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-08-02T12:15:04+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "7c71fc2932158d00f24f10635bf3b3b8b6ee5b68" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/7c71fc2932158d00f24f10635bf3b3b8b6ee5b68", - "reference": "7c71fc2932158d00f24f10635bf3b3b8b6ee5b68", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2019-07-02T13:37:32+00:00" - }, - { - "name": "hamcrest/hamcrest-php", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "c0436bf63689fc334f67ccaa5e17458af9700b42" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/c0436bf63689fc334f67ccaa5e17458af9700b42", - "reference": "c0436bf63689fc334f67ccaa5e17458af9700b42", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "^1.4", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0", - "satooshi/php-coveralls": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "hamcrest" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "time": "2019-04-18T04:49:30+00:00" - }, - { - "name": "mockery/mockery", - "version": "1.2.3", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "4eff936d83eb809bde2c57a3cea0ee9643769031" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/4eff936d83eb809bde2c57a3cea0ee9643769031", - "reference": "4eff936d83eb809bde2c57a3cea0ee9643769031", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "~2.0", - "lib-pcre": ">=7.0", - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework", - "homepage": "https://github.com/mockery/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "time": "2019-08-07T15:01:07+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2019-08-09T12:45:53+00:00" - }, - { - "name": "phar-io/manifest", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "8c8bd1bb1a22f311b1b4886662b989d0d02aab77" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/8c8bd1bb1a22f311b1b4886662b989d0d02aab77", - "reference": "8c8bd1bb1a22f311b1b4886662b989d0d02aab77", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^2.0", - "php": "^7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" - }, - { - "name": "Sebastian Heuer", - "role": "Developer", - "email": "sebastian@phpeople.de" - }, - { - "name": "Sebastian Bergmann", - "role": "Developer", - "email": "sebastian@phpunit.de" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2019-07-09T12:18:04+00:00" - }, - { - "name": "phar-io/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" - }, - { - "name": "Sebastian Heuer", - "role": "Developer", - "email": "sebastian@phpeople.de" - }, - { - "name": "Sebastian Bergmann", - "role": "Developer", - "email": "sebastian@phpunit.de" - } - ], - "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-04-30T17:48:53+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2019-06-13T12:50:23+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "7743bbcfff2a907e9ee4a25be13d0f8ec5e73800" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7743bbcfff2a907e9ee4a25be13d0f8ec5e73800", - "reference": "7743bbcfff2a907e9ee4a25be13d0f8ec5e73800", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2019-07-25T05:31:54+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "7f0f29702170e2786b2df813af970135765de6fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/7f0f29702170e2786b2df813af970135765de6fc", - "reference": "7f0f29702170e2786b2df813af970135765de6fc", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2019-07-02T07:44:20+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "37d2894f3650acccb6e57207e63eb9699c1a82a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/37d2894f3650acccb6e57207e63eb9699c1a82a6", - "reference": "37d2894f3650acccb6e57207e63eb9699c1a82a6", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2019-07-02T07:42:03+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e899757bb3df5ff6e95089132f32cd59aac2220a", - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2019-07-25T05:29:42+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f12f04116fa2c16efee389e7c8cfa9c48929820a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f12f04116fa2c16efee389e7c8cfa9c48929820a", - "reference": "f12f04116fa2c16efee389e7c8cfa9c48929820a", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2.0", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.1", - "phar-io/manifest": "^1.0.3", - "phar-io/version": "^2.0.1", - "php": "^7.2", - "phpspec/prophecy": "^1.8.1", - "phpunit/php-code-coverage": "^7.0.7", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.2", - "sebastian/exporter": "^3.1.1", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2019-08-21T07:06:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "5e860800beea5ea4c8590df866338c09c20d3a48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e860800beea5ea4c8590df866338c09c20d3a48", - "reference": "5e860800beea5ea4c8590df866338c09c20d3a48", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2019-07-02T07:44:03+00:00" - }, - { - "name": "sebastian/comparator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "9a1267ac19ecd74163989bcb3e01c5c9587f9e3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/9a1267ac19ecd74163989bcb3e01c5c9587f9e3b", - "reference": "9a1267ac19ecd74163989bcb3e01c5c9587f9e3b", - "shasum": "" - }, - "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2019-07-02T07:45:15+00:00" - }, - { - "name": "sebastian/diff", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "d7e7810940c78f3343420f76adf92dc437b7a557" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/d7e7810940c78f3343420f76adf92dc437b7a557", - "reference": "d7e7810940c78f3343420f76adf92dc437b7a557", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "time": "2019-07-02T07:43:30+00:00" - }, - { - "name": "sebastian/environment", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1c91ab3fb351373cf86ead6006ea9daa8e4ce027" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1c91ab3fb351373cf86ead6006ea9daa8e4ce027", - "reference": "1c91ab3fb351373cf86ead6006ea9daa8e4ce027", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2019-07-02T07:44:59+00:00" - }, - { - "name": "sebastian/exporter", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "636773fb0b23bd70fff886ffe215ed47354af863" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/636773fb0b23bd70fff886ffe215ed47354af863", - "reference": "636773fb0b23bd70fff886ffe215ed47354af863", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2019-08-14T15:08:01+00:00" - }, - { - "name": "sebastian/global-state", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "cb007dcac528018e8ba48e2f77239416e13d01c2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/cb007dcac528018e8ba48e2f77239416e13d01c2", - "reference": "cb007dcac528018e8ba48e2f77239416e13d01c2", - "shasum": "" - }, - "require": { - "php": "^7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2019-07-02T07:44:52+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "63e5a3e0881ebf28c9fbb2a2e12b77d373850c12" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/63e5a3e0881ebf28c9fbb2a2e12b77d373850c12", - "reference": "63e5a3e0881ebf28c9fbb2a2e12b77d373850c12", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2019-07-02T07:43:46+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "3053ae3e6286fdf98769f18ec10894dbc6260a34" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/3053ae3e6286fdf98769f18ec10894dbc6260a34", - "reference": "3053ae3e6286fdf98769f18ec10894dbc6260a34", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2019-07-02T07:44:36+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "a58220ae18565f6004bbe15321efc4470bfe02fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/a58220ae18565f6004bbe15321efc4470bfe02fd", - "reference": "a58220ae18565f6004bbe15321efc4470bfe02fd", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2019-07-02T07:43:54+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "d67fc89d3107c396d161411b620619f3e7a7c270" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/d67fc89d3107c396d161411b620619f3e7a7c270", - "reference": "d67fc89d3107c396d161411b620619f3e7a7c270", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2019-07-02T07:42:50+00:00" - }, - { - "name": "sebastian/type", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", - "shasum": "" - }, - "require": { - "php": "^7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "time": "2019-07-02T08:10:15+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2019-08-06T08:03:45+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2018-12-25T11:19:39+00:00" - } - ], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.5" - }, - "platform-dev": [] -} From 1e537f5c14d3f29db841ee3907eb322727a49d24 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 11:56:21 +0330 Subject: [PATCH 06/19] WIP --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index ddda496..6fd8b2f 100755 --- a/composer.json +++ b/composer.json @@ -10,10 +10,10 @@ ], "keywords": ["Laravel","Date","Datetime","Jalali", "Shamsi", "Verta"], "require": { - "php": "^7.2.5|^8.0|^8.1", + "php": "^7.3|^8.0|^8.1", "hekmatinasser/notowo": "^1.0", - "illuminate/validation": "^5|^6|^7|^8|9", - "illuminate/support": "^5|^6|^7|^8|9" + "illuminate/validation": "^6|^7|^8|9", + "illuminate/support": "^6|^7|^8|9" }, "require-dev" : { "orchestra/testbench": "^4.9|^6.23|^7.0", From f2099c5a121e46996bd401a36f1105f77719b331 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 12:01:01 +0330 Subject: [PATCH 07/19] WIP --- .gitignore | 1 + composer.json | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0ec8775..ac28cc8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ vendor/ .idea/ *.phpunit.result.cache *.bat +composer.lock diff --git a/composer.json b/composer.json index 6fd8b2f..443d6b9 100755 --- a/composer.json +++ b/composer.json @@ -11,9 +11,9 @@ "keywords": ["Laravel","Date","Datetime","Jalali", "Shamsi", "Verta"], "require": { "php": "^7.3|^8.0|^8.1", - "hekmatinasser/notowo": "^1.0", - "illuminate/validation": "^6|^7|^8|9", - "illuminate/support": "^6|^7|^8|9" + "illuminate/support": "^6.0|^8.0|^9.0", + "illuminate/validation": "^6.0|^8.0|^9.0", + "hekmatinasser/notowo": "^1.0" }, "require-dev" : { "orchestra/testbench": "^4.9|^6.23|^7.0", From 4e3ebda436acb6248edca9771a8b9887472cd50a Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 12:40:44 +0330 Subject: [PATCH 08/19] WIP --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 443d6b9..a44bbb4 100755 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "keywords": ["Laravel","Date","Datetime","Jalali", "Shamsi", "Verta"], "require": { - "php": "^7.3|^8.0|^8.1", + "php": "^7.3|^8.0", "illuminate/support": "^6.0|^8.0|^9.0", "illuminate/validation": "^6.0|^8.0|^9.0", "hekmatinasser/notowo": "^1.0" From 2ecdd114216478f9c52fe1ad05cbc6bc5f4f6891 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 12:52:37 +0330 Subject: [PATCH 09/19] WIP --- .gitignore | 1 + phpunit.xml.dist | 40 ++++++++++++++------------------------- src/Traits/Comparison.php | 3 ++- tests/ComparisionTest.php | 2 -- 4 files changed, 17 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index ac28cc8..d6caadd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ vendor/ *.phpunit.result.cache *.bat composer.lock +phpunit.xml.dist.bak diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6c74953..b11a58d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,31 +1,19 @@ - - - - ./tests - - - - - ./src - - - - - + diff --git a/src/Traits/Comparison.php b/src/Traits/Comparison.php index a6fc9b6..6801793 100644 --- a/src/Traits/Comparison.php +++ b/src/Traits/Comparison.php @@ -497,7 +497,8 @@ trait Comparison /** * Checks if the passed in date is in the same month as the instance month (and year if needed). - * + * $this->assertFalse($datetime->isCurrentMonth()); + * @param Verta|null $v The instance to compare with or null to use current day. * @param bool $ofSameYear Check if it is the same month in the same year. * diff --git a/tests/ComparisionTest.php b/tests/ComparisionTest.php index 9324798..c51dfd8 100644 --- a/tests/ComparisionTest.php +++ b/tests/ComparisionTest.php @@ -267,8 +267,6 @@ class ComparisionTest extends TestCase $this->assertFalse($datetime->isSameAs('Y-m-d')); $this->assertFalse($datetime->isCurrentYear()); $this->assertFalse($datetime->isSameYear($target)); - $this->assertFalse($datetime->isCurrentMonth()); - $this->assertFalse($datetime->isSameMonth()); $this->assertFalse($datetime->isSameDay($target)); $this->assertTrue($datetime->isBirthday($target)); $this->assertFalse($datetime->isSaturday()); From 5397a612f3a4d3c4cf80b6381eb352ce74b92350 Mon Sep 17 00:00:00 2001 From: iamfarhad Date: Sun, 16 Jan 2022 09:23:03 +0000 Subject: [PATCH 10/19] Fix styling --- .php-cs-fixer.cache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 2423cca..5d65806 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.1","version":"3.5.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Traits\/Translator.php":448542714,"src\/Traits\/Comparison.php":3926327020,"src\/Traits\/Boundaries.php":177542658,"src\/Traits\/Creator.php":1689858777,"src\/Traits\/Formatting.php":113682988,"src\/Traits\/Accessor.php":3672088395,"src\/Traits\/Difference.php":1846129813,"src\/Traits\/Modification.php":1289161807,"src\/Traits\/Transformation.php":2767394386,"src\/Traits\/Date.php":337576065,"src\/VertaInterface.php":2606416261,"src\/Verta.php":1398063567,"src\/Lang\/ps.php":1557833854,"src\/Lang\/en.php":4059164324,"src\/Lang\/haz.php":67156656,"src\/Lang\/ku.php":1336513500,"src\/Lang\/az.php":722372108,"src\/Lang\/fa.php":1662853050,"src\/Lang\/ar.php":1426472215,"src\/helpers.php":2970057840,"src\/Laravel\/VertaServiceProvider.php":3527274115,"src\/Laravel\/JalaliValidator.php":539122976,"src\/Facades\/Verta.php":8857523,"tests\/ComparisionTest.php":1311523399,"tests\/AccessTest.php":434586276,"tests\/CreatorTest.php":4251091983,"tests\/FormatTest.php":1791904145,"tests\/bootstrap.php":2741744302,"tests\/ModificationTest.php":966836384}} \ No newline at end of file +{"php":"8.1.1","version":"3.5.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Traits\/Translator.php":448542714,"src\/Traits\/Comparison.php":1536147406,"src\/Traits\/Boundaries.php":177542658,"src\/Traits\/Creator.php":1689858777,"src\/Traits\/Formatting.php":113682988,"src\/Traits\/Accessor.php":3672088395,"src\/Traits\/Difference.php":1846129813,"src\/Traits\/Modification.php":1289161807,"src\/Traits\/Transformation.php":2767394386,"src\/Traits\/Date.php":337576065,"src\/VertaInterface.php":2606416261,"src\/Verta.php":1398063567,"src\/Lang\/ps.php":1557833854,"src\/Lang\/en.php":4059164324,"src\/Lang\/haz.php":67156656,"src\/Lang\/ku.php":1336513500,"src\/Lang\/az.php":722372108,"src\/Lang\/fa.php":1662853050,"src\/Lang\/ar.php":1426472215,"src\/helpers.php":2970057840,"src\/Laravel\/VertaServiceProvider.php":3527274115,"src\/Laravel\/JalaliValidator.php":539122976,"src\/Facades\/Verta.php":8857523,"tests\/ComparisionTest.php":1699503712,"tests\/AccessTest.php":434586276,"tests\/CreatorTest.php":4251091983,"tests\/FormatTest.php":1791904145,"tests\/bootstrap.php":2741744302,"tests\/ModificationTest.php":966836384}} \ No newline at end of file From b2f0f3ea1e4f0fe07cd8a789a70e12e5acb52f60 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 12:54:57 +0330 Subject: [PATCH 11/19] WIP --- .github/workflows/run-tests.yml | 4 ++-- composer.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b980745..6f3f3d1 100755 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,8 +9,8 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.1, 8.0, 7.3, 7.4] - laravel: [6.*,8.*,9.*] + php: [5.7,8.1, 8.0, 7.3, 7.4] + laravel: [5.*,6.*,8.*,9.*] dependency-version: [prefer-lowest, prefer-stable] include: - laravel: 8.* diff --git a/composer.json b/composer.json index a44bbb4..57435fa 100755 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ "keywords": ["Laravel","Date","Datetime","Jalali", "Shamsi", "Verta"], "require": { "php": "^7.3|^8.0", - "illuminate/support": "^6.0|^8.0|^9.0", - "illuminate/validation": "^6.0|^8.0|^9.0", + "illuminate/support": "^5.0|^6.0|^8.0|^9.0", + "illuminate/validation": "^5.0|^6.0|^8.0|^9.0", "hekmatinasser/notowo": "^1.0" }, "require-dev" : { From af295103cc64c49eaaf3f78825a8253dbf4caaf5 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 12:57:14 +0330 Subject: [PATCH 12/19] WIP --- .github/workflows/run-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 6f3f3d1..be28d48 100755 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [5.7,8.1, 8.0, 7.3, 7.4] + php: [8.1, 8.0, 7.3, 7.4] laravel: [5.*,6.*,8.*,9.*] dependency-version: [prefer-lowest, prefer-stable] include: @@ -27,7 +27,9 @@ jobs: php: 7.3 - laravel: 9.* php: 7.4 - + - laravel: 5.* + php: 7.4 + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} From ea56657356886d7c5a739f41d09d069044dd8a25 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 12:58:48 +0330 Subject: [PATCH 13/19] WIP --- .php-cs-fixer.cache | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .php-cs-fixer.cache diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache deleted file mode 100644 index 5d65806..0000000 --- a/.php-cs-fixer.cache +++ /dev/null @@ -1 +0,0 @@ -{"php":"8.1.1","version":"3.5.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Traits\/Translator.php":448542714,"src\/Traits\/Comparison.php":1536147406,"src\/Traits\/Boundaries.php":177542658,"src\/Traits\/Creator.php":1689858777,"src\/Traits\/Formatting.php":113682988,"src\/Traits\/Accessor.php":3672088395,"src\/Traits\/Difference.php":1846129813,"src\/Traits\/Modification.php":1289161807,"src\/Traits\/Transformation.php":2767394386,"src\/Traits\/Date.php":337576065,"src\/VertaInterface.php":2606416261,"src\/Verta.php":1398063567,"src\/Lang\/ps.php":1557833854,"src\/Lang\/en.php":4059164324,"src\/Lang\/haz.php":67156656,"src\/Lang\/ku.php":1336513500,"src\/Lang\/az.php":722372108,"src\/Lang\/fa.php":1662853050,"src\/Lang\/ar.php":1426472215,"src\/helpers.php":2970057840,"src\/Laravel\/VertaServiceProvider.php":3527274115,"src\/Laravel\/JalaliValidator.php":539122976,"src\/Facades\/Verta.php":8857523,"tests\/ComparisionTest.php":1699503712,"tests\/AccessTest.php":434586276,"tests\/CreatorTest.php":4251091983,"tests\/FormatTest.php":1791904145,"tests\/bootstrap.php":2741744302,"tests\/ModificationTest.php":966836384}} \ No newline at end of file From c29b86c592e39bd69348c4faa8fa404a6d49bb37 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 12:58:59 +0330 Subject: [PATCH 14/19] WIP --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d6caadd..6d8b1bb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ vendor/ *.bat composer.lock phpunit.xml.dist.bak +.php-cs-fixer.cache From d031923b3eb87787f26975a63725eb6651b549fa Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 12:59:55 +0330 Subject: [PATCH 15/19] WIP --- .github/workflows/run-tests.yml | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index be28d48..5b6538a 100755 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -10,7 +10,7 @@ jobs: matrix: os: [ubuntu-latest] php: [8.1, 8.0, 7.3, 7.4] - laravel: [5.*,6.*,8.*,9.*] + laravel: [6.*,8.*,9.*] dependency-version: [prefer-lowest, prefer-stable] include: - laravel: 8.* diff --git a/composer.json b/composer.json index 57435fa..fff48e3 100755 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ "keywords": ["Laravel","Date","Datetime","Jalali", "Shamsi", "Verta"], "require": { "php": "^7.3|^8.0", - "illuminate/support": "^5.0|^6.0|^8.0|^9.0", - "illuminate/validation": "^5.0|^6.0|^8.0|^9.0", + "illuminate/support": "^^6.0|^8.0|^9.0", + "illuminate/validation": "^6.0|^8.0|^9.0", "hekmatinasser/notowo": "^1.0" }, "require-dev" : { From 4709dad82b60b6ec2007b161f4ee03fd6dcbd043 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 13:05:44 +0330 Subject: [PATCH 16/19] WIP --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index fff48e3..443d6b9 100755 --- a/composer.json +++ b/composer.json @@ -10,8 +10,8 @@ ], "keywords": ["Laravel","Date","Datetime","Jalali", "Shamsi", "Verta"], "require": { - "php": "^7.3|^8.0", - "illuminate/support": "^^6.0|^8.0|^9.0", + "php": "^7.3|^8.0|^8.1", + "illuminate/support": "^6.0|^8.0|^9.0", "illuminate/validation": "^6.0|^8.0|^9.0", "hekmatinasser/notowo": "^1.0" }, From f8f1a19f57298e41aac1de1fa17286c85a12e4a3 Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 13:10:55 +0330 Subject: [PATCH 17/19] WIP --- phpunit.xml.dist | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b11a58d..917405f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,19 +1,16 @@ - - + + - ./src + src/ - - ./tests + + ./tests/ - + From 0ffbf24f3a37b386a45e090ccd5a0c5e264e6dff Mon Sep 17 00:00:00 2001 From: Farhad Zand Date: Sun, 16 Jan 2022 13:16:56 +0330 Subject: [PATCH 18/19] fix run test --- .github/workflows/run-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5b6538a..fb81875 100755 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -27,9 +27,6 @@ jobs: php: 7.3 - laravel: 9.* php: 7.4 - - laravel: 5.* - php: 7.4 - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} From 3f859351a313789523436c879b6382378c3471da Mon Sep 17 00:00:00 2001 From: iamfarhad Date: Sat, 5 Feb 2022 06:23:52 +0000 Subject: [PATCH 19/19] Fix styling --- src/Traits/Formatting.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Traits/Formatting.php b/src/Traits/Formatting.php index ed41918..0531cd0 100644 --- a/src/Traits/Formatting.php +++ b/src/Traits/Formatting.php @@ -259,7 +259,8 @@ trait Formatting { $offset = $this->clone()->startYear()->format('w'); $days = $this->format('z'); - return ceil( ($days + $offset) / 7 ); + + return ceil(($days + $offset) / 7); } /**