File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33namespace lbarulski \CacheTagsBundle \Invalidator ;
44
55use lbarulski \CacheTagsBundle \Service \Repository ;
6- use lbarulski \CacheTagsBundle \Tag \TagInterface ;
6+ use lbarulski \CacheTagsBundle \Tag \CacheTagInterface ;
77
88class Invalidator implements InvalidatorInterface
99{
@@ -20,7 +20,10 @@ public function __construct(Repository $repository)
2020 $ this ->repository = $ repository ;
2121 }
2222
23- public function invalidate (TagInterface $ tag )
23+ /**
24+ * @param CacheTagInterface $tag
25+ */
26+ public function invalidate (CacheTagInterface $ tag )
2427 {
2528 $ this ->repository ->add ($ tag );
2629 }
Original file line number Diff line number Diff line change 22
33namespace lbarulski \CacheTagsBundle \Invalidator ;
44
5- use lbarulski \CacheTagsBundle \Tag \TagInterface ;
5+ use lbarulski \CacheTagsBundle \Tag \CacheTagInterface ;
66
77interface InvalidatorInterface
88{
9- public function invalidate (TagInterface $ tag );
9+ /**
10+ * @param CacheTagInterface $tag
11+ */
12+ public function invalidate (CacheTagInterface $ tag );
1013}
Original file line number Diff line number Diff line change 44
55use lbarulski \CacheTagsBundle \Invalidator \Proxy \ManagerInterface ;
66use lbarulski \CacheTagsBundle \Service \Repository ;
7- use lbarulski \CacheTagsBundle \Tag \TagInterface ;
7+ use lbarulski \CacheTagsBundle \Tag \CacheTagInterface ;
88
99class InvalidatorListener
1010{
@@ -35,11 +35,11 @@ public function invalidate()
3535 }
3636
3737 /**
38- * @param TagInterface $tag
38+ * @param CacheTagInterface $tag
3939 */
40- private function invalidateTag (TagInterface $ tag )
40+ private function invalidateTag (CacheTagInterface $ tag )
4141 {
42- $ tagValue = $ tag ->getTag ();
42+ $ tagValue = $ tag ->getCacheTag ();
4343 $ proxies = $ this ->manager ->getProxies ();
4444 foreach ($ proxies as $ proxy )
4545 {
Original file line number Diff line number Diff line change 66
77namespace lbarulski \CacheTagsBundle \Service ;
88
9- use lbarulski \CacheTagsBundle \Tag \TagInterface ;
9+ use lbarulski \CacheTagsBundle \Tag \CacheTagInterface ;
1010
1111class Repository
1212{
1313 /**
14- * @var TagInterface []
14+ * @var CacheTagInterface []
1515 */
1616 private $ tags = [];
1717
1818 /**
19- * @param TagInterface $tag
19+ * @param CacheTagInterface $tag
2020 */
21- public function add (TagInterface $ tag )
21+ public function add (CacheTagInterface $ tag )
2222 {
2323 $ this ->tags [] = $ tag ;
2424 }
2525
2626 /**
27- * @return TagInterface []
27+ * @return CacheTagInterface []
2828 */
2929 public function getTags ()
3030 {
Original file line number Diff line number Diff line change 66
77namespace lbarulski \CacheTagsBundle \Service ;
88
9- use lbarulski \CacheTagsBundle \Tag \TagInterface ;
9+ use lbarulski \CacheTagsBundle \Tag \CacheTagInterface ;
1010use Symfony \Component \HttpFoundation \Response ;
1111
1212class Tagger
@@ -24,15 +24,15 @@ public function __construct($headerName)
2424
2525 /**
2626 * @param Response $response
27- * @param TagInterface [] $tags
27+ * @param CacheTagInterface [] $tags
2828 * @param bool $replace
2929 */
3030 public function tagResponse (Response $ response , $ tags , $ replace = false )
3131 {
3232 $ tagValues = [];
3333 foreach ($ tags as $ tag )
3434 {
35- $ tagValues [] = $ tag ->getTag ();
35+ $ tagValues [] = $ tag ->getCacheTag ();
3636 }
3737
3838 if (!$ replace && $ response ->headers ->has ($ this ->headerName ))
Original file line number Diff line number Diff line change 66
77namespace lbarulski \CacheTagsBundle \Tag ;
88
9- interface TagInterface
9+ interface CacheTagInterface
1010{
1111 /**
1212 * @return string
1313 */
14- public function getTag ();
14+ public function getCacheTag ();
1515}
Original file line number Diff line number Diff line change 66
77namespace lbarulski \CacheTagsBundle \Tag ;
88
9- class Plain implements TagInterface
9+ class Plain implements CacheTagInterface
1010{
1111 /**
1212 * @var string
@@ -22,7 +22,7 @@ public function __construct($value)
2222 }
2323
2424 /** {@inheritdoc} */
25- public function getTag ()
25+ public function getCacheTag ()
2626 {
2727 return $ this ->value ;
2828 }
Original file line number Diff line number Diff line change @@ -111,13 +111,13 @@ public function articleAction(Request $request)
111111``` php
112112// Acme\MainBundle\Entity\Article.php
113113
114- use lbarulski\CacheTagsBundle\Tag\TagInterface ;
114+ use lbarulski\CacheTagsBundle\Tag\CacheTagInterface ;
115115
116- class Article implements TagInterface
116+ class Article implements CacheTagInterface
117117{
118118 ...
119119
120- public function getTag ()
120+ public function getCacheTag ()
121121 {
122122 return 'article_'.$this->getId();
123123 }
You can’t perform that action at this time.
0 commit comments