Overview

Namespaces

  • Deimos
    • Cookie
      • Extensions
  • PHP

Classes

  • Deimos\Cookie\Cookie
  • Deimos\Cookie\Extension
  • Deimos\Cookie\SecureDefault

Interfaces

  • Throwable

Traits

  • Deimos\Cookie\Extensions\Flash
  • Deimos\Cookie\Extensions\Option
  • Deimos\Cookie\Extensions\Variable

Exceptions

  • Exception
  • InvalidArgumentException
  • LogicException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: 
 3: namespace Deimos\Cookie\Extensions;
 4: 
 5: use Deimos\Cookie\Extension;
 6: 
 7: trait Option
 8: {
 9: 
10:     /**
11:      * @var array
12:      */
13:     private $options = [
14:         Extension::OPTION_EXPIRE    => 0,
15:         Extension::OPTION_PATH      => '/',
16:         Extension::OPTION_DOMAIN    => null,
17:         Extension::OPTION_SECURE    => [],
18:         Extension::OPTION_HTTP_ONLY => false,
19:     ];
20: 
21:     /**
22:      * @param array $first
23:      * @param array $second
24:      *
25:      * @return array
26:      */
27:     protected function merge(array $first, array $second)
28:     {
29:         if (isset($second[Extension::OPTION_LIFETIME]))
30:         {
31:             $second[Extension::OPTION_EXPIRE] = $second[Extension::OPTION_LIFETIME] + time();
32:             unset($second[Extension::OPTION_LIFETIME]);
33:         }
34: 
35:         return array_merge($first, $second);
36:     }
37: 
38: }
API documentation generated by ApiGen