<?php

namespace Illuminate\Cache\Events;
// namespace to set
class CacheHit
{
    /**
     * The key that was hit.
     *
     * @var string
     */
    public $key;// a cache key will be hit

    /**
     * The value that was retrieved.
     *
     * @var mixed
     */
    public $value;// a value be get by key,in the cache

    /**
     * The tags that were assigned to the key.
     *
     * @var array
     */
    public $tags;// a tags care about the key

    /**
     * Create a new event instance.
     *
     * @param  string  $key
     * @param  mixed  $value
     * @param  array  $tags
     * @return void
     */
    public function __construct($key, $value, array $tags = [])
    {
        $this->key = $key;// set key
        $this->tags = $tags;// set tags
        $this->value = $value;// set value
    }// create a new event instance.
}