[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/laminas/laminas-diactoros/src/ -> UploadedFileFactory.php (source)

   1  <?php
   2  
   3  /**
   4   * @see       https://github.com/laminas/laminas-diactoros for the canonical source repository
   5   * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md
   6   * @license   https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License
   7   */
   8  
   9  declare(strict_types=1);
  10  
  11  namespace Laminas\Diactoros;
  12  
  13  use Psr\Http\Message\StreamInterface;
  14  use Psr\Http\Message\UploadedFileFactoryInterface;
  15  use Psr\Http\Message\UploadedFileInterface;
  16  
  17  use const UPLOAD_ERR_OK;
  18  
  19  class UploadedFileFactory implements UploadedFileFactoryInterface
  20  {
  21      /**
  22       * {@inheritDoc}
  23       */
  24      public function createUploadedFile(
  25          StreamInterface $stream,
  26          int $size = null,
  27          int $error = UPLOAD_ERR_OK,
  28          string $clientFilename = null,
  29          string $clientMediaType = null
  30      ) : UploadedFileInterface {
  31          if ($size === null) {
  32              $size = $stream->getSize();
  33          }
  34  
  35          return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType);
  36      }
  37  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer