From 6c347ae99e7315be4e15b083532fbb8c4c1caa0c Mon Sep 17 00:00:00 2001 From: zagreusinoz Date: Wed, 1 Nov 2017 15:10:14 +1100 Subject: [PATCH 1/2] Implemented Ended and Invited flags --- .idea/deployment.xml | 35 + .idea/laravel-eloquent-flag.iml | 8 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 814 ++++++++++++++++++ README.md | 4 + composer.json | 3 +- src/Scopes/Classic/InvitedAtScope.php | 128 +++ src/Scopes/Classic/InvitedFlagScope.php | 127 +++ src/Scopes/Inverse/EndedAtScope.php | 128 +++ src/Scopes/Inverse/EndedFlagScope.php | 127 +++ src/Traits/Classic/HasInvitedAt.php | 23 + src/Traits/Classic/HasInvitedAtHelpers.php | 90 ++ src/Traits/Classic/HasInvitedAtScope.php | 32 + src/Traits/Classic/HasInvitedFlag.php | 23 + src/Traits/Classic/HasInvitedFlagHelpers.php | 88 ++ src/Traits/Classic/HasInvitedFlagScope.php | 32 + src/Traits/Inverse/HasEndedAt.php | 23 + src/Traits/Inverse/HasEndedAtHelpers.php | 90 ++ src/Traits/Inverse/HasEndedAtScope.php | 32 + src/Traits/Inverse/HasEndedFlag.php | 23 + src/Traits/Inverse/HasEndedFlagHelpers.php | 88 ++ src/Traits/Inverse/HasEndedFlagScope.php | 32 + .../Models/Classic/EntityWithInvitedAt.php | 50 ++ .../Classic/EntityWithInvitedAtUnapplied.php | 30 + .../Models/Classic/EntityWithInvitedFlag.php | 50 ++ .../EntityWithInvitedFlagUnapplied.php | 30 + .../Models/Inverse/EntityWithEndedAt.php | 50 ++ .../Inverse/EntityWithEndedAtUnapplied.php | 30 + .../Models/Inverse/EntityWithEndedFlag.php | 50 ++ .../Inverse/EntityWithEndedFlagUnapplied.php | 30 + .../Scopes/Classic/InvitedAtScopeTest.php | 128 +++ .../Scopes/Classic/InvitedFlagScopeTest.php | 127 +++ .../Unit/Scopes/Inverse/EndedAtScopeTest.php | 128 +++ .../Scopes/Inverse/EndedFlagScopeTest.php | 127 +++ .../Classic/HasInvitedAtHelpersTest.php | 102 +++ .../Classic/HasInvitedFlagHelpersTest.php | 101 +++ .../Traits/Inverse/HasEndedAtHelpersTest.php | 102 +++ .../Inverse/HasEndedFlagHelpersTest.php | 101 +++ .../factories/EntityWithEndedAtFactory.php | 17 + .../factories/EntityWithEndedFlagFactory.php | 17 + .../factories/EntityWithInvitedAtFactory.php | 17 + .../EntityWithInvitedFlagFactory.php | 17 + ...2750_create_entity_with_ended_at_table.php | 45 + ...50_create_entity_with_ended_flag_table.php | 45 + ...50_create_entity_with_invited_at_table.php | 45 + ..._create_entity_with_invited_flag_table.php | 45 + 47 files changed, 3447 insertions(+), 1 deletion(-) create mode 100644 .idea/deployment.xml create mode 100644 .idea/laravel-eloquent-flag.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 src/Scopes/Classic/InvitedAtScope.php create mode 100644 src/Scopes/Classic/InvitedFlagScope.php create mode 100644 src/Scopes/Inverse/EndedAtScope.php create mode 100644 src/Scopes/Inverse/EndedFlagScope.php create mode 100644 src/Traits/Classic/HasInvitedAt.php create mode 100644 src/Traits/Classic/HasInvitedAtHelpers.php create mode 100644 src/Traits/Classic/HasInvitedAtScope.php create mode 100644 src/Traits/Classic/HasInvitedFlag.php create mode 100644 src/Traits/Classic/HasInvitedFlagHelpers.php create mode 100644 src/Traits/Classic/HasInvitedFlagScope.php create mode 100644 src/Traits/Inverse/HasEndedAt.php create mode 100644 src/Traits/Inverse/HasEndedAtHelpers.php create mode 100644 src/Traits/Inverse/HasEndedAtScope.php create mode 100644 src/Traits/Inverse/HasEndedFlag.php create mode 100644 src/Traits/Inverse/HasEndedFlagHelpers.php create mode 100644 src/Traits/Inverse/HasEndedFlagScope.php create mode 100644 tests/Stubs/Models/Classic/EntityWithInvitedAt.php create mode 100644 tests/Stubs/Models/Classic/EntityWithInvitedAtUnapplied.php create mode 100644 tests/Stubs/Models/Classic/EntityWithInvitedFlag.php create mode 100644 tests/Stubs/Models/Classic/EntityWithInvitedFlagUnapplied.php create mode 100644 tests/Stubs/Models/Inverse/EntityWithEndedAt.php create mode 100644 tests/Stubs/Models/Inverse/EntityWithEndedAtUnapplied.php create mode 100644 tests/Stubs/Models/Inverse/EntityWithEndedFlag.php create mode 100644 tests/Stubs/Models/Inverse/EntityWithEndedFlagUnapplied.php create mode 100644 tests/Unit/Scopes/Classic/InvitedAtScopeTest.php create mode 100644 tests/Unit/Scopes/Classic/InvitedFlagScopeTest.php create mode 100644 tests/Unit/Scopes/Inverse/EndedAtScopeTest.php create mode 100644 tests/Unit/Scopes/Inverse/EndedFlagScopeTest.php create mode 100644 tests/Unit/Traits/Classic/HasInvitedAtHelpersTest.php create mode 100644 tests/Unit/Traits/Classic/HasInvitedFlagHelpersTest.php create mode 100644 tests/Unit/Traits/Inverse/HasEndedAtHelpersTest.php create mode 100644 tests/Unit/Traits/Inverse/HasEndedFlagHelpersTest.php create mode 100644 tests/database/factories/EntityWithEndedAtFactory.php create mode 100644 tests/database/factories/EntityWithEndedFlagFactory.php create mode 100644 tests/database/factories/EntityWithInvitedAtFactory.php create mode 100644 tests/database/factories/EntityWithInvitedFlagFactory.php create mode 100644 tests/database/migrations/2016_09_25_182750_create_entity_with_ended_at_table.php create mode 100644 tests/database/migrations/2016_09_25_182750_create_entity_with_ended_flag_table.php create mode 100644 tests/database/migrations/2016_09_25_182750_create_entity_with_invited_at_table.php create mode 100644 tests/database/migrations/2016_09_25_182750_create_entity_with_invited_flag_table.php diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..50150c7 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/laravel-eloquent-flag.iml b/.idea/laravel-eloquent-flag.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/laravel-eloquent-flag.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ed5c1ee --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..02208c0 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,814 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Expired + EntityWithEnded + Entity + enti + exp + end_at + unend + ver + + + Ended + + + C:\Users\Jamie\Documents\laravel-eloquent-flag\tests + C:\Users\Jamie\Documents\laravel-eloquent-flag\src + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1509504140068 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file