Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Auto-Discovery / Fix missing lib for testing / Upgrade phpunit / Make it compatible with PHP 7.2 #31

Merged
merged 6 commits into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: php

php:
- 5.6
- 7.0
- 7.1
- 7.2

sudo: false

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ First, install the package through Composer.
composer require hootlex/laravel-moderation
```

Then include the service provider inside `config/app.php`.

If you are using Laravel < 5.5, you need to add Hootlex\Moderation\ModerationServiceProvider to your `config/app.php` providers array:
```php
'providers' => [
...
Expand Down
19 changes: 16 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"name": "hootlex/laravel-moderation",
"description": "A simple Content Moderation System for Laravel 5.* that allows you to Approve or Reject resources like posts, comments, users, etc.",
"keywords": ["laravel", "moderation", "moderation-system", "content-moderation"],
"keywords": [
"laravel",
"moderation",
"moderation-system",
"content-moderation"
],
"license": "MIT",
"authors": [
{
Expand All @@ -19,12 +24,20 @@
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit" : "5.*",
"laravel/laravel": "5.*"
"phpunit/phpunit": "7.0",
"laravel/laravel": "5.*",
"nunomaduro/collision": "^2.0"
},
"autoload": {
"psr-4": {
"Hootlex\\Moderation\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Hootlex\\Moderation\\ModerationServiceProvider"
]
}
}
}
2 changes: 1 addition & 1 deletion src/ModerationScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ protected function addPend(Builder $builder)
*/
protected function getStatusColumn(Builder $builder)
{
if (count($builder->getQuery()->joins) > 0) {
if ($builder->getQuery()->joins && count($builder->getQuery()->joins) > 0) {
return $builder->getModel()->getQualifiedStatusColumn();
} else {
return $builder->getModel()->getStatusColumn();
Expand Down
6 changes: 0 additions & 6 deletions tests/ModerationScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ public function it_returns_only_pending_stories()
}
}

/** @test */
public function it_returns_only_postponed_stories()
{

}

/** @test */
public function it_returns_stories_including_pending_ones()
{
Expand Down