Skip to content

Commit 62ce0db

Browse files
authored
Merge pull request #1 from SimpleSoftwareIO/analysis-87GvWk
Apply fixes from StyleCI
2 parents f381ae5 + 6d014ba commit 62ce0db

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

src/Cacheable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ trait Cacheable
2727
protected $cacheBusting = false;
2828

2929
/**
30-
* Overrides the default QueryBuilder to inject the Cache methods
30+
* Overrides the default QueryBuilder to inject the Cache methods.
3131
*
3232
* @return QueryCacheBuilder
3333
*/
@@ -41,7 +41,7 @@ protected function newBaseQueryBuilder()
4141
}
4242

4343
/**
44-
* Generates a new QueryCache
44+
* Generates a new QueryCache.
4545
*
4646
* @return QueryCache
4747
*/
@@ -112,4 +112,4 @@ public function isBusting()
112112
{
113113
return $this->cacheBusting;
114114
}
115-
}
115+
}

src/QueryCache.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace SimpleSoftwareIO\Cache;
44

55
use Illuminate\Cache\TaggableStore;
6-
use Illuminate\Database\Eloquent\Collection;
76
use Illuminate\Support\Facades\Cache;
7+
use Illuminate\Database\Eloquent\Collection;
88

99
class QueryCache
1010
{
@@ -81,7 +81,9 @@ public function disable()
8181
*/
8282
public function get(QueryCacheBuilder $builder, $columns = ['*'])
8383
{
84-
if (! $this->enabled()) return $this->performQuery($builder, $columns);
84+
if (! $this->enabled()) {
85+
return $this->performQuery($builder, $columns);
86+
}
8587

8688
$key = $this->generateKey($builder, $columns);
8789

@@ -93,7 +95,7 @@ public function get(QueryCacheBuilder $builder, $columns = ['*'])
9395
}
9496

9597
/**
96-
* Gets a Cache instance
98+
* Gets a Cache instance.
9799
*
98100
* @return Cache
99101
*/
@@ -158,8 +160,10 @@ protected function getTag(QueryCacheBuilder $builder)
158160
*/
159161
public function flush($tag)
160162
{
161-
if ($this->isTaggable()) return Cache::tags($tag)->flush();
163+
if ($this->isTaggable()) {
164+
return Cache::tags($tag)->flush();
165+
}
162166

163167
return Cache::flush();
164168
}
165-
}
169+
}

src/QueryCacheBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace SimpleSoftwareIO\Cache;
44

5-
use Illuminate\Database\ConnectionInterface;
65
use Illuminate\Database\Query\Builder;
6+
use Illuminate\Database\ConnectionInterface;
77
use Illuminate\Database\Query\Grammars\Grammar;
88
use Illuminate\Database\Query\Processors\Processor;
99

@@ -78,4 +78,4 @@ public function dontRemember()
7878

7979
return $this;
8080
}
81-
}
81+
}

tests/CacheableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ public function dont_bust_disables_cache_busting()
101101

102102
$this->assertFalse($model->isBusting());
103103
}
104-
}
104+
}

tests/QueryCacheBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
use SimpleSoftwareIO\Cache\QueryCache;
4-
use SimpleSoftwareIO\Cache\QueryCacheBuilder;
54
use Illuminate\Database\ConnectionInterface;
5+
use SimpleSoftwareIO\Cache\QueryCacheBuilder;
66
use Illuminate\Database\Query\Grammars\Grammar;
77
use Illuminate\Database\Query\Processors\Processor;
88

@@ -60,4 +60,4 @@ public function dont_remember_disables_caching()
6060

6161
$this->builder->dontRemember();
6262
}
63-
}
63+
}

tests/QueryCacheTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?php
22

33
use Illuminate\Support\Facades\Cache;
4+
use Illuminate\Support\Facades\Facade;
45
use SimpleSoftwareIO\Cache\QueryCache;
56
use SimpleSoftwareIO\Cache\QueryCacheBuilder;
6-
use Illuminate\Support\Facades\Facade;
77

88
class QueryCacheTest extends PHPUnit_Framework_TestCase
99
{
10-
1110
public function setUp()
1211
{
1312
Facade::clearResolvedInstances();
@@ -235,4 +234,4 @@ public function cache_is_flushed_for_everything_if_tagging_is_not_supported()
235234

236235
$queryCache->flush($queryCacheBuilder);
237236
}
238-
}
237+
}

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
require_once __DIR__.'/../vendor/autoload.php';
3+
require_once __DIR__.'/../vendor/autoload.php';

0 commit comments

Comments
 (0)