PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0
Elementor Website Builder – more than just a page builder v4.3.0
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
elementor / vendor_prefixed / twig / symfony / polyfill-php81 / Resources / stubs / CURLStringFile.php

CURLStringFile.php in Elementor Website Builder – more than just a page builder 4.3.0, at vendor_prefixed/twig/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php

46 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ElementorDeps;
4
5 /*
6 * This file is part of the Symfony package.
7 *
8 * (c) Fabien Potencier <[email protected]>
9 *
10 * For the full copyright and license information, please view the LICENSE
11 * file that was distributed with this source code.
12 */
13 if (\PHP_VERSION_ID >= 70400 && \extension_loaded('curl')) {
14 /**
15 * @property string $data
16 */
17 class CURLStringFile extends \CURLFile
18 {
19 private $data;
20 public function __construct(string $data, string $postname, string $mime = 'application/octet-stream')
21 {
22 $this->data = $data;
23 parent::__construct('data://application/octet-stream;base64,' . \base64_encode($data), $mime, $postname);
24 }
25 public function __set(string $name, $value) : void
26 {
27 if ('data' !== $name) {
28 $this->{$name} = $value;
29 return;
30 }
31 if (\is_object($value) ? !\method_exists($value, '__toString') : !\is_scalar($value)) {
32 throw new \TypeError('Cannot assign ' . \gettype($value) . ' to property CURLStringFile::$data of type string');
33 }
34 $this->name = 'data://application/octet-stream;base64,' . \base64_encode($value);
35 }
36 public function __isset(string $name) : bool
37 {
38 return isset($this->{$name});
39 }
40 public function &__get(string $name)
41 {
42 return $this->{$name};
43 }
44 }
45 }
46