Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • CacheControlHeader
  • CallableDispatcher
  • ContentDispositionHeader
  • ContentTypeHeader
  • DateHeader
  • Dispatcher
  • File
  • FileList
  • Header
  • HeaderParameter
  • Headers
  • Helpers
  • RedirectResponse
  • Request
  • Response
  • WeightedDispatcher

Interfaces

  • IDispatcher

Exceptions

  • ForceRedirect
  • HTTPError
  • MethodNotSupported
  • NotFound
  • ServiceUnavailable
  • StatusCodeNotValid

Functions

  • dispatch
  • get_dispatcher
  • get_initial_request
 1 <?php
 2 
 3 /*
 4  * This file is part of the ICanBoogie package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace ICanBoogie\HTTP;
13 
14 /**
15  * Representation of a list of request files.
16  */
17 class FileList implements \ArrayAccess, \IteratorAggregate, \Countable
18 {
19     static public function from($files)
20     {
21         if ($files instanceof self)
22         {
23             return clone $files;
24         }
25 
26         if (!$files)
27         {
28             return new static([]);
29         }
30 
31         foreach ($files as &$file)
32         {
33             $file = File::from($file);
34         }
35 
36         return new static($files);
37     }
38 
39     protected $list;
40 
41     public function __construct(array $files)
42     {
43         foreach ($files as $id => $file)
44         {
45             $this[$id] = $file;
46         }
47     }
48 
49     public function offsetExists($id)
50     {
51         return isset($this->list[$id]);
52     }
53 
54     public function offsetGet($id)
55     {
56         if (!$this->offsetExists($id))
57         {
58             return;
59         }
60 
61         return $this->list[$id];
62     }
63 
64     public function offsetSet($id, $file)
65     {
66         if (!($file instanceof File || $file instanceof FileList))
67         {
68             $file = File::from($file);
69         }
70 
71         $this->list[$id] = $file;
72     }
73 
74     public function offsetUnset($id)
75     {
76         unset($this->list[$id]);
77     }
78 
79     public function getIterator()
80     {
81         return new \ArrayIterator($this->list);
82     }
83 
84     public function count()
85     {
86         return count($this->list);
87     }
88 }
Autodoc API documentation generated by ApiGen 2.8.0