├── .env ├── .htaccess ├── App ├── Controllers │ └── HomeController.php └── Models │ └── User.php ├── README.md ├── Tidy ├── Application.php ├── Database │ ├── Concerns │ │ └── Connect.php │ ├── DB.php │ ├── Grammars │ │ └── MySQLGrammer.php │ ├── Managers │ │ ├── Main │ │ │ └── DatabaseManager.php │ │ └── MySQLManager.php │ └── Model │ │ └── Model.php ├── Http │ ├── Request.php │ ├── Response.php │ └── Route.php ├── Support │ ├── Arr.php │ ├── Config.php │ ├── Hash.php │ ├── Session.php │ ├── Str.php │ └── helper.php ├── Validation │ ├── ErrorBag.php │ ├── Message.php │ ├── Rules │ │ ├── AlphaNumRule.php │ │ ├── BetweenRule.php │ │ ├── EmailRule.php │ │ ├── ImageRule.php │ │ ├── MaxRule.php │ │ ├── MimeRule.php │ │ ├── MinRule.php │ │ ├── NumRule.php │ │ ├── Required.php │ │ ├── Rule.php │ │ └── StringRule.php │ ├── RulesMapper.php │ ├── RulesResolver.php │ └── Validator.php └── View │ └── View.php ├── composer.json ├── composer.lock ├── config └── database.php ├── public ├── .htaccess ├── assets │ ├── css │ │ └── 404.css │ ├── images │ │ ├── TidyPHP.png │ │ ├── astronaut.svg │ │ ├── planet.svg │ │ └── tidy-logo.png │ └── js │ │ └── 404.js └── index.php ├── routes └── web.php ├── vendor ├── autoload.php ├── bin │ ├── var-dump-server │ └── var-dump-server.bat ├── composer │ ├── ClassLoader.php │ ├── InstalledVersions.php │ ├── LICENSE │ ├── autoload_classmap.php │ ├── autoload_files.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_real.php │ ├── autoload_static.php │ ├── installed.json │ ├── installed.php │ └── platform_check.php ├── graham-campbell │ └── result-type │ │ ├── LICENSE │ │ ├── composer.json │ │ └── src │ │ ├── Error.php │ │ ├── Result.php │ │ └── Success.php ├── phpoption │ └── phpoption │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── composer.json │ │ └── src │ │ └── PhpOption │ │ ├── LazyOption.php │ │ ├── None.php │ │ ├── Option.php │ │ └── Some.php ├── symfony │ ├── polyfill-ctype │ │ ├── Ctype.php │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bootstrap.php │ │ ├── bootstrap80.php │ │ └── composer.json │ ├── polyfill-mbstring │ │ ├── LICENSE │ │ ├── Mbstring.php │ │ ├── README.md │ │ ├── Resources │ │ │ └── unidata │ │ │ │ ├── lowerCase.php │ │ │ │ ├── titleCaseRegexp.php │ │ │ │ └── upperCase.php │ │ ├── bootstrap.php │ │ ├── bootstrap80.php │ │ └── composer.json │ ├── polyfill-php80 │ │ ├── LICENSE │ │ ├── Php80.php │ │ ├── README.md │ │ ├── Resources │ │ │ └── stubs │ │ │ │ ├── Attribute.php │ │ │ │ ├── Stringable.php │ │ │ │ ├── UnhandledMatchError.php │ │ │ │ └── ValueError.php │ │ ├── bootstrap.php │ │ └── composer.json │ └── var-dumper │ │ ├── CHANGELOG.md │ │ ├── Caster │ │ ├── AmqpCaster.php │ │ ├── ArgsStub.php │ │ ├── Caster.php │ │ ├── ClassStub.php │ │ ├── ConstStub.php │ │ ├── CutArrayStub.php │ │ ├── CutStub.php │ │ ├── DOMCaster.php │ │ ├── DateCaster.php │ │ ├── DoctrineCaster.php │ │ ├── DsCaster.php │ │ ├── DsPairStub.php │ │ ├── EnumStub.php │ │ ├── ExceptionCaster.php │ │ ├── FrameStub.php │ │ ├── GmpCaster.php │ │ ├── ImagineCaster.php │ │ ├── ImgStub.php │ │ ├── IntlCaster.php │ │ ├── LinkStub.php │ │ ├── MemcachedCaster.php │ │ ├── PdoCaster.php │ │ ├── PgSqlCaster.php │ │ ├── ProxyManagerCaster.php │ │ ├── RdKafkaCaster.php │ │ ├── RedisCaster.php │ │ ├── ReflectionCaster.php │ │ ├── ResourceCaster.php │ │ ├── SplCaster.php │ │ ├── StubCaster.php │ │ ├── SymfonyCaster.php │ │ ├── TraceStub.php │ │ ├── UuidCaster.php │ │ ├── XmlReaderCaster.php │ │ └── XmlResourceCaster.php │ │ ├── Cloner │ │ ├── AbstractCloner.php │ │ ├── ClonerInterface.php │ │ ├── Cursor.php │ │ ├── Data.php │ │ ├── DumperInterface.php │ │ ├── Stub.php │ │ └── VarCloner.php │ │ ├── Command │ │ ├── Descriptor │ │ │ ├── CliDescriptor.php │ │ │ ├── DumpDescriptorInterface.php │ │ │ └── HtmlDescriptor.php │ │ └── ServerDumpCommand.php │ │ ├── Dumper │ │ ├── AbstractDumper.php │ │ ├── CliDumper.php │ │ ├── ContextProvider │ │ │ ├── CliContextProvider.php │ │ │ ├── ContextProviderInterface.php │ │ │ ├── RequestContextProvider.php │ │ │ └── SourceContextProvider.php │ │ ├── ContextualizedDumper.php │ │ ├── DataDumperInterface.php │ │ ├── HtmlDumper.php │ │ └── ServerDumper.php │ │ ├── Exception │ │ └── ThrowingCasterException.php │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Resources │ │ ├── bin │ │ │ └── var-dump-server │ │ ├── css │ │ │ └── htmlDescriptor.css │ │ ├── functions │ │ │ └── dump.php │ │ └── js │ │ │ └── htmlDescriptor.js │ │ ├── Server │ │ ├── Connection.php │ │ └── DumpServer.php │ │ ├── Test │ │ └── VarDumperTestTrait.php │ │ ├── VarDumper.php │ │ └── composer.json └── vlucas │ └── phpdotenv │ ├── LICENSE │ ├── composer.json │ └── src │ ├── Dotenv.php │ ├── Exception │ ├── ExceptionInterface.php │ ├── InvalidEncodingException.php │ ├── InvalidFileException.php │ ├── InvalidPathException.php │ └── ValidationException.php │ ├── Loader │ ├── Loader.php │ ├── LoaderInterface.php │ └── Resolver.php │ ├── Parser │ ├── Entry.php │ ├── EntryParser.php │ ├── Lexer.php │ ├── Lines.php │ ├── Parser.php │ ├── ParserInterface.php │ └── Value.php │ ├── Repository │ ├── Adapter │ │ ├── AdapterInterface.php │ │ ├── ApacheAdapter.php │ │ ├── ArrayAdapter.php │ │ ├── EnvConstAdapter.php │ │ ├── GuardedWriter.php │ │ ├── ImmutableWriter.php │ │ ├── MultiReader.php │ │ ├── MultiWriter.php │ │ ├── PutenvAdapter.php │ │ ├── ReaderInterface.php │ │ ├── ReplacingWriter.php │ │ ├── ServerConstAdapter.php │ │ └── WriterInterface.php │ ├── AdapterRepository.php │ ├── RepositoryBuilder.php │ └── RepositoryInterface.php │ ├── Store │ ├── File │ │ ├── Paths.php │ │ └── Reader.php │ ├── FileStore.php │ ├── StoreBuilder.php │ ├── StoreInterface.php │ └── StringStore.php │ ├── Util │ ├── Regex.php │ └── Str.php │ └── Validator.php └── views ├── errors └── 404.php ├── home.php └── layouts └── app.php /.env: -------------------------------------------------------------------------------- 1 | APP_NAME=TidyPHP 2 | URL = http://localhost:8080 3 | 4 | DB_DRIVER=mysql 5 | DB_DATABASE=mvc 6 | DB_USERNAME=root 7 | DB_PASSWORD= 8 | DB_HOST=localhost -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteCond %{REQUEST_URI} !^public 3 | RewriteRule ^(.*)$ public/$1 [L] -------------------------------------------------------------------------------- /App/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | request = new Request; 26 | $this->response = new Response; 27 | $this->route = new Route($this->request, $this->response); 28 | $this->config = new Config($this->loadConfigurations()); 29 | $this->db = new DB($this->getDatabaseDriver()); 30 | $this->session = new Session; 31 | } 32 | 33 | protected function getDatabaseDriver() { 34 | 35 | // can add drivers 36 | if (env('DB_DRIVER') == 'mysql') { 37 | // dump(new MySQLManager); 38 | return new MySQLManager; 39 | } else return new MySQLManager; 40 | 41 | } 42 | 43 | protected function loadConfigurations() { 44 | foreach(scandir(config_path()) as $file) { 45 | if ($file == '.' || $file == '..') { 46 | continue; 47 | } 48 | $filename = explode('.', $file)[0]; 49 | yield $filename => require config_path() . $file; 50 | 51 | } 52 | } 53 | 54 | public function run() { 55 | $this->db->init(); 56 | $this->route->resolve(); 57 | 58 | } 59 | 60 | public function __get($name) { 61 | if(property_exists($this, $name)) { 62 | return $this->$name; 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Tidy/Database/Concerns/Connect.php: -------------------------------------------------------------------------------- 1 | connect(); 10 | } 11 | } -------------------------------------------------------------------------------- /Tidy/Database/Managers/Main/DatabaseManager.php: -------------------------------------------------------------------------------- 1 | db->create($attributes); 16 | } 17 | 18 | public static function all() { 19 | self::$instance = static::class; 20 | 21 | return app()->db->read(); 22 | } 23 | 24 | public static function find($id) { 25 | self::$instance = static::class; 26 | 27 | return app()->db->read('*' , ['id' , '=' , $id]); 28 | } 29 | public static function update($id, array $attributes){ 30 | self::$instance = static::class; 31 | 32 | return app()->db->update($id, $attributes); 33 | } 34 | public static function delete($id) { 35 | self::$instance = static::class; 36 | 37 | return app()->db->delete($id); 38 | } 39 | 40 | 41 | 42 | public static function where( $filter, $columns = '*') { 43 | self::$instance = static::class; 44 | 45 | return DB::table(static::getTableName())->select($columns)->where($filter); 46 | 47 | } 48 | 49 | public static function whereIn($col , $filter, $columns = '*') { 50 | self::$instance = static::class; 51 | 52 | return DB::table(static::getTableName())->select($columns)->whereIn($col , $filter); 53 | 54 | } 55 | 56 | public static function whereNotIn($col , $filter, $columns = '*') { 57 | self::$instance = static::class; 58 | 59 | return DB::table(static::getTableName())->select($columns)->whereNotIn($col , $filter); 60 | 61 | } 62 | 63 | public static function orderBy($filter, $type = '') { 64 | self::$instance = static::class; 65 | 66 | return DB::table(static::getTableName())->orderBy($filter,$type); 67 | 68 | } 69 | public static function groupBy($filter , $columns = '*') { 70 | self::$instance = static::class; 71 | 72 | return DB::table(static::getTableName())->select($columns)->groupBy($filter); 73 | 74 | } 75 | 76 | 77 | public static function getModel() { 78 | self::$instance = static::class; 79 | 80 | return self::$instance; 81 | } 82 | 83 | public static function getTableName() { 84 | if(static::$table == null) 85 | return Str::lower(Str::plural(class_basename(self::$instance))); 86 | else return static::$table; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Tidy/Http/Response.php: -------------------------------------------------------------------------------- 1 | $item) { 12 | $this->items[$key] = $item; 13 | } 14 | } 15 | 16 | public function has($keys) 17 | { 18 | return Arr::has($this->items, $keys); 19 | } 20 | 21 | public function get($key, $default = null) 22 | { 23 | if (is_array($key)) { 24 | return $this->getMany($key); 25 | } 26 | 27 | return Arr::get($this->items, $key, $default); 28 | } 29 | 30 | public function getMany($keys) 31 | { 32 | $config = []; 33 | 34 | foreach ($keys as $key => $default) { 35 | if (is_numeric($key)) { 36 | [$key, $default] = [$default, null]; 37 | } 38 | 39 | $config[$key] = Arr::get($this->items, $key, $default); 40 | } 41 | 42 | return $config; 43 | } 44 | 45 | public function set($key, $value = null) 46 | { 47 | $keys = is_array($key) ? $key : [$key => $value]; 48 | 49 | foreach ($keys as $key => $value) { 50 | Arr::set($this->items, $key, $value); 51 | } 52 | } 53 | 54 | public function push($key, $value) 55 | { 56 | $array = $this->get($key); 57 | 58 | $array[] = $value; 59 | 60 | $this->set($key, ...$array); 61 | } 62 | 63 | public function all() 64 | { 65 | return $this->items; 66 | } 67 | 68 | public function exists($key) 69 | { 70 | return Arr::exists($this->items, $key); 71 | } 72 | 73 | public function offsetGet($offset) 74 | { 75 | $this->get($offset); 76 | } 77 | 78 | public function offsetSet($offset, $value) 79 | { 80 | $this->set($offset, $value); 81 | } 82 | 83 | public function offsetUnset($offset) 84 | { 85 | $this->set($offset, null); 86 | } 87 | 88 | public function offsetExists($offset) 89 | { 90 | $this->exists($offset); 91 | } 92 | } -------------------------------------------------------------------------------- /Tidy/Support/Hash.php: -------------------------------------------------------------------------------- 1 | &$flashMessage) { 12 | $flashMessage['remove'] = true; 13 | } 14 | $_SESSION[self::FLASH_KEY] = $flashMessages; 15 | } 16 | 17 | public function setFlash($key, $message) { 18 | 19 | $_SESSION[self::FLASH_KEY][$key] = [ 20 | 'remove' => false, 21 | 'value' => $message 22 | ]; 23 | 24 | } 25 | 26 | public function getFlash($key) { 27 | // dump($_SESSION); 28 | return $_SESSION[self::FLASH_KEY][$key]['value'] ?? false; 29 | } 30 | 31 | public function set($key, $value) { 32 | $_SESSION[$key] = $value; 33 | } 34 | 35 | public function hasFlash($key){ 36 | return (isset($_SESSION[self::FLASH_KEY][$key])); 37 | } 38 | 39 | public function exists($key){ 40 | return (isset($_SESSION[$key])); 41 | } 42 | 43 | public function get($key){ 44 | return $_SESSION[$key] ?? false; 45 | } 46 | 47 | public function remove($key) { 48 | unset($_SESSION[$key]); 49 | } 50 | 51 | public function __destruct() { 52 | $this->removeFlashMessages(); 53 | } 54 | 55 | private function removeFlashMessages() { 56 | $flashMessages = $_SESSION[self::FLASH_KEY] ?? []; 57 | foreach ($flashMessages as $key => $flashMessage) { 58 | if ($flashMessage['remove']) { 59 | unset($flashMessages[$key]); 60 | } 61 | } 62 | $_SESSION[self::FLASH_KEY] = $flashMessages; 63 | } 64 | } -------------------------------------------------------------------------------- /Tidy/Validation/ErrorBag.php: -------------------------------------------------------------------------------- 1 | errors[$field][] = $message; 10 | } 11 | 12 | public function __get($name) 13 | { 14 | if (property_exists($this, $name)) { 15 | return $this->$name; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Tidy/Validation/Message.php: -------------------------------------------------------------------------------- 1 | min = $min; 10 | $this->max = $max; 11 | } 12 | 13 | public function apply($field, $value, $data = []){ 14 | 15 | if (strlen($value) < $this->min || strlen($value) > $this->max) { 16 | return false; 17 | } 18 | 19 | return true; 20 | } 21 | 22 | public function __toString() 23 | { 24 | return "%s must be between {$this->min} and {$this->max} characters"; 25 | } 26 | } -------------------------------------------------------------------------------- /Tidy/Validation/Rules/EmailRule.php: -------------------------------------------------------------------------------- 1 | types)) { 10 | return false; 11 | } 12 | 13 | return true; 14 | } 15 | 16 | public function __toString() { 17 | return "%s must be an image"; 18 | } 19 | } -------------------------------------------------------------------------------- /Tidy/Validation/Rules/MaxRule.php: -------------------------------------------------------------------------------- 1 | max = $max; 9 | } 10 | 11 | public function apply($field, $value, $data = []) 12 | { 13 | if (strlen($value) > $this->max) { 14 | return false; 15 | } 16 | 17 | return true; 18 | } 19 | 20 | public function __toString() { 21 | return "%s must be less than {$this->max} characters"; 22 | } 23 | } -------------------------------------------------------------------------------- /Tidy/Validation/Rules/MimeRule.php: -------------------------------------------------------------------------------- 1 | types = $params; 11 | } 12 | 13 | public function apply($field, $value, $data = []) { 14 | 15 | if (!in_array( end(explode('.' , $value)) , $this->types)) { 16 | return false; 17 | } 18 | 19 | return true; 20 | } 21 | 22 | public function __toString() { 23 | 24 | $values = implode(',' , $this->types); 25 | 26 | return "%s must be mimes " . $values . " only"; 27 | } 28 | } -------------------------------------------------------------------------------- /Tidy/Validation/Rules/MinRule.php: -------------------------------------------------------------------------------- 1 | min = $min; 9 | } 10 | 11 | public function apply($field, $value, $data = []) 12 | { 13 | if (strlen($value) < $this->min) { 14 | return false; 15 | } 16 | 17 | return true; 18 | } 19 | 20 | public function __toString() 21 | { 22 | return "%s must be more than {$this->min} characters"; 23 | } 24 | } -------------------------------------------------------------------------------- /Tidy/Validation/Rules/NumRule.php: -------------------------------------------------------------------------------- 1 | Required::class, 18 | 'alnum' => AlphaNumRule::class, 19 | 'max' => MaxRule::class, 20 | 'between' => BetweenRule::class, 21 | 'email' => EmailRule::class, 22 | 'unique' => UniqueRule::class, 23 | 'image' => ImageRule::class , 24 | 'min' => MinRule::class , 25 | 'mimes' => MimeRule::class, 26 | 'number' => NumRule::class, 27 | 'string' => StringRule::class 28 | ]; 29 | 30 | 31 | public static function resolve(string $rule, $options) { 32 | 33 | return new static::$map[$rule](...$options); 34 | } 35 | } -------------------------------------------------------------------------------- /Tidy/Validation/RulesResolver.php: -------------------------------------------------------------------------------- 1 | data = $data; 17 | $this->errorBag = new ErrorBag(); 18 | $this->validate(); 19 | } 20 | 21 | protected function validate(){ 22 | foreach ($this->rules as $field => $rules) { 23 | foreach (RulesResolver::make($rules) as $rule) { 24 | $this->applyRule($field, $rule); 25 | } 26 | } 27 | } 28 | 29 | protected function applyRule($field, Rule $rule){ 30 | if (!$rule->apply($field, $this->getFieldValue($field), $this->data)) { 31 | $this->errorBag->add($field, Message::generate($rule, $this->alias($field))); 32 | } 33 | } 34 | 35 | protected function getFieldValue($field){ 36 | return $this->data[$field] ?? null; 37 | } 38 | 39 | public function setRules($rules){ 40 | $this->rules = $rules; 41 | } 42 | 43 | public function errorsExist(){ 44 | return !empty($this->errors()); 45 | } 46 | 47 | public function errors($key = null){ 48 | return $key ? $this->errorBag->errors[$key] : $this->errorBag->errors; 49 | } 50 | 51 | public function alias($field){ 52 | return $this->aliases[$field] ?? $field; 53 | } 54 | 55 | public function setAliases(array $aliases){ 56 | $this->aliases = $aliases; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Tidy/View/View.php: -------------------------------------------------------------------------------- 1 | "; 38 | // dump($path . $view ); 39 | if (is_dir($path . $view)) { 40 | $path = $path . $view . '/'; 41 | } 42 | 43 | } 44 | $view = $path . end($views) . '.php'; 45 | } else { 46 | $view = $path . $view . '.php'; 47 | } 48 | 49 | // to send data['users'] and extract users array in view 50 | foreach($params as $param => $value) { 51 | $$param = $value; 52 | } 53 | 54 | // dump($view); 55 | 56 | if($is_view) 57 | include $view; 58 | else { 59 | ob_start(); 60 | include $view; 61 | return ob_get_clean(); 62 | } 63 | 64 | } 65 | 66 | public function with($params = []) 67 | { 68 | foreach($params as $param => $value) { 69 | $$param = $value; 70 | } 71 | 72 | } 73 | } -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tidyphp/tidyphp", 3 | "description": "A TidyPHP is a micro Framework for build fast and tidy web applications", 4 | "keywords": [ 5 | "microframework", 6 | "php" , 7 | "routing" 8 | ], 9 | "license": "MIT", 10 | "authors": [ 11 | { 12 | "name": "Amin Yasser", 13 | "email": "alaminyasser0@gmail.com" 14 | } 15 | ], 16 | "require": { 17 | "vlucas/phpdotenv": "^5.3", 18 | "symfony/var-dumper": "^5.3" 19 | }, 20 | "autoload": { 21 | "psr-4": { 22 | "App\\": "App/", 23 | "Tidy\\": "Tidy/" 24 | } 25 | 26 | }, 27 | "scripts": { 28 | "serve": "php -S localhost:8080 -t public" 29 | }, 30 | "config": { 31 | "process-timeout": 0 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_DRIVER' , 'mysql') , 4 | 'username' => env('DB_USERNAME' , 'root') , 5 | 'password' => env('DB_PASSWORD' , '') , 6 | 7 | ]; -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteBase / 3 | 4 | RewriteCond %{REQUEST_FILENAME} !-f 5 | RewriteCond %{REQUEST_FILENAME} !-d 6 | RewriteRule ^(.*)$ index.php?$1 [L,QSA] -------------------------------------------------------------------------------- /public/assets/css/404.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Dosis:300,400,700,800"); 2 | 3 | /** Styles for the 403 Page **/ 4 | 5 | .particle-error, 6 | .permission_denied, 7 | #tsparticles { 8 | width: 100%; 9 | height: 100%; 10 | margin: 0px !important; 11 | } 12 | 13 | #tsparticles { 14 | position: fixed !important; 15 | opacity: 0.23; 16 | } 17 | 18 | .permission_denied { 19 | background: #24344c !important; 20 | } 21 | 22 | .permission_denied a { 23 | text-decoration: none; 24 | } 25 | 26 | .denied__wrapper { 27 | max-width: 390px; 28 | width: 100%; 29 | height: 300px; 30 | display: block; 31 | margin: 0 auto; 32 | position: relative; 33 | margin-top: 8vh; 34 | } 35 | 36 | .permission_denied h1 { 37 | text-align: center; 38 | color: #fff; 39 | font-family: "Dosis", sans-serif; 40 | font-size: 100px; 41 | margin-bottom: 0px; 42 | font-weight: 800; 43 | } 44 | 45 | .permission_denied h3 { 46 | text-align: center; 47 | color: #fff; 48 | font-size: 19px; 49 | line-height: 23px; 50 | max-width: 330px; 51 | margin: 0px auto 30px auto; 52 | font-family: "Dosis", sans-serif; 53 | font-weight: 400; 54 | } 55 | 56 | .permission_denied h3 span { 57 | position: relative; 58 | width: 65px; 59 | display: inline-block; 60 | } 61 | 62 | .permission_denied h3 span:after { 63 | content: ""; 64 | border-bottom: 3px solid #ffbb39; 65 | position: absolute; 66 | left: 0; 67 | top: 43%; 68 | width: 100%; 69 | } 70 | 71 | .denied__link { 72 | background: none; 73 | color: #fff; 74 | padding: 12px 0px 10px 0px; 75 | border: 1px solid #fff; 76 | outline: none; 77 | border-radius: 7px; 78 | width: 150px; 79 | font-size: 15px; 80 | text-align: center; 81 | margin: 0 auto; 82 | vertical-align: middle; 83 | display: block; 84 | margin-bottom: 40px; 85 | margin-top: 25px; 86 | font-family: "Dosis", sans-serif; 87 | font-weight: 400; 88 | } 89 | 90 | .denied__link:hover { 91 | color: #ffbb39; 92 | border-color: #ffbb39; 93 | cursor: pointer; 94 | opacity: 1; 95 | } 96 | 97 | .permission_denied .stars { 98 | animation: sparkle 1.6s infinite ease-in-out alternate; 99 | } 100 | 101 | @keyframes sparkle { 102 | 0% { 103 | opacity: 1; 104 | } 105 | 100% { 106 | opacity: 0.3; 107 | } 108 | } 109 | 110 | #astronaut { 111 | width: 43px; 112 | position: absolute; 113 | right: 20px; 114 | top: 210px; 115 | animation: spin 4.5s infinite linear; 116 | } 117 | 118 | @keyframes spin { 119 | 0% { 120 | transform: rotateZ(0deg); 121 | } 122 | 100% { 123 | transform: rotateZ(360deg); 124 | } 125 | } 126 | 127 | @media (max-width: 600px) { 128 | .permission_denied h1 { 129 | font-size: 75px; 130 | } 131 | .permission_denied h3 { 132 | font-size: 16px; 133 | width: 200px; 134 | margin: 0 auto; 135 | line-height: 23px; 136 | } 137 | .permission_denied h3 span { 138 | width: 60px; 139 | } 140 | #astronaut { 141 | width: 35px; 142 | right: 40px; 143 | top: 170px; 144 | } 145 | } 146 | 147 | .saturn, 148 | .saturn-2, 149 | .hover { 150 | animation: hover 2s infinite ease-in-out alternate; 151 | } 152 | 153 | @keyframes hover { 154 | 0% { 155 | transform: translateY(3px); 156 | } 157 | 100% { 158 | transform: translateY(-3px); 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /public/assets/images/TidyPHP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aminyasser/TidyPHP/b77d14c7de1e13b6a9cf51ab06c45313d8e95239/public/assets/images/TidyPHP.png -------------------------------------------------------------------------------- /public/assets/images/tidy-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aminyasser/TidyPHP/b77d14c7de1e13b6a9cf51ab06c45313d8e95239/public/assets/images/tidy-logo.png -------------------------------------------------------------------------------- /public/assets/js/404.js: -------------------------------------------------------------------------------- 1 | var particles = { 2 | fpsLimit: 60, 3 | particles: { 4 | number: { 5 | value: 160, 6 | density: { 7 | enable: true, 8 | area: 800 9 | } 10 | }, 11 | color: { 12 | value: "#ffffff" 13 | }, 14 | shape: { 15 | type: "circle" 16 | }, 17 | opacity: { 18 | value: 1, 19 | random: { 20 | enable: true, 21 | minimumValue: 0.1 22 | }, 23 | animation: { 24 | enable: true, 25 | speed: 1, 26 | minimumValue: 0, 27 | sync: false 28 | } 29 | }, 30 | size: { 31 | value: 3, 32 | random: { 33 | enable: true, 34 | minimumValue: 1 35 | } 36 | }, 37 | move: { 38 | enable: true, 39 | speed: 0.17, 40 | direction: "none", 41 | random: true, 42 | straight: false, 43 | outModes: { 44 | default: "out" 45 | }, 46 | } 47 | }, 48 | interactivity: { 49 | detectsOn: "canvas", 50 | events: { 51 | resize: false 52 | } 53 | }, 54 | detectRetina: true 55 | }; 56 | 57 | tsParticles.load("tsparticles", particles); 58 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | load(); 14 | 15 | app()->run(); 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | /dev/null; cd "../symfony/var-dumper/Resources/bin" && pwd) 4 | 5 | if [ -d /proc/cygdrive ]; then 6 | case $(which php) in 7 | $(readlink -n /proc/cygdrive)/*) 8 | # We are in Cygwin using Windows php, so the path must be translated 9 | dir=$(cygpath -m "$dir"); 10 | ;; 11 | esac 12 | fi 13 | 14 | "${dir}/var-dump-server" "$@" 15 | -------------------------------------------------------------------------------- /vendor/bin/var-dump-server.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | setlocal DISABLEDELAYEDEXPANSION 3 | SET BIN_TARGET=%~dp0/../symfony/var-dumper/Resources/bin/var-dump-server 4 | php "%BIN_TARGET%" %* 5 | -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /vendor/composer/autoload_classmap.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 10 | 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 11 | 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 12 | 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 13 | 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', 14 | ); 15 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 10 | 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 11 | '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', 12 | '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 13 | ); 14 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($baseDir . '/Tidy'), 10 | 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), 11 | 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 12 | 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), 13 | 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), 14 | 'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'), 15 | 'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'), 16 | 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), 17 | 'App\\' => array($baseDir . '/App'), 18 | ); 19 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 32 | if ($useStaticLoader) { 33 | require __DIR__ . '/autoload_static.php'; 34 | 35 | call_user_func(\Composer\Autoload\ComposerStaticInit328fcd67419f644c2538e7839b034e70::getInitializer($loader)); 36 | } else { 37 | $map = require __DIR__ . '/autoload_namespaces.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->set($namespace, $path); 40 | } 41 | 42 | $map = require __DIR__ . '/autoload_psr4.php'; 43 | foreach ($map as $namespace => $path) { 44 | $loader->setPsr4($namespace, $path); 45 | } 46 | 47 | $classMap = require __DIR__ . '/autoload_classmap.php'; 48 | if ($classMap) { 49 | $loader->addClassMap($classMap); 50 | } 51 | } 52 | 53 | $loader->register(true); 54 | 55 | if ($useStaticLoader) { 56 | $includeFiles = Composer\Autoload\ComposerStaticInit328fcd67419f644c2538e7839b034e70::$files; 57 | } else { 58 | $includeFiles = require __DIR__ . '/autoload_files.php'; 59 | } 60 | foreach ($includeFiles as $fileIdentifier => $file) { 61 | composerRequire328fcd67419f644c2538e7839b034e70($fileIdentifier, $file); 62 | } 63 | 64 | return $loader; 65 | } 66 | } 67 | 68 | function composerRequire328fcd67419f644c2538e7839b034e70($fileIdentifier, $file) 69 | { 70 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 71 | require $file; 72 | 73 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /vendor/composer/installed.php: -------------------------------------------------------------------------------- 1 | 3 | array ( 4 | 'pretty_version' => '1.0.0+no-version-set', 5 | 'version' => '1.0.0.0', 6 | 'aliases' => 7 | array ( 8 | ), 9 | 'reference' => NULL, 10 | 'name' => 'tidyphp/tidyphp', 11 | ), 12 | 'versions' => 13 | array ( 14 | 'graham-campbell/result-type' => 15 | array ( 16 | 'pretty_version' => 'v1.0.2', 17 | 'version' => '1.0.2.0', 18 | 'aliases' => 19 | array ( 20 | ), 21 | 'reference' => '84afea85c6841deeea872f36249a206e878a5de0', 22 | ), 23 | 'phpoption/phpoption' => 24 | array ( 25 | 'pretty_version' => '1.8.0', 26 | 'version' => '1.8.0.0', 27 | 'aliases' => 28 | array ( 29 | ), 30 | 'reference' => '5455cb38aed4523f99977c4a12ef19da4bfe2a28', 31 | ), 32 | 'symfony/polyfill-ctype' => 33 | array ( 34 | 'pretty_version' => 'v1.23.0', 35 | 'version' => '1.23.0.0', 36 | 'aliases' => 37 | array ( 38 | ), 39 | 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', 40 | ), 41 | 'symfony/polyfill-mbstring' => 42 | array ( 43 | 'pretty_version' => 'v1.23.1', 44 | 'version' => '1.23.1.0', 45 | 'aliases' => 46 | array ( 47 | ), 48 | 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', 49 | ), 50 | 'symfony/polyfill-php80' => 51 | array ( 52 | 'pretty_version' => 'v1.23.1', 53 | 'version' => '1.23.1.0', 54 | 'aliases' => 55 | array ( 56 | ), 57 | 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', 58 | ), 59 | 'symfony/var-dumper' => 60 | array ( 61 | 'pretty_version' => 'v5.3.8', 62 | 'version' => '5.3.8.0', 63 | 'aliases' => 64 | array ( 65 | ), 66 | 'reference' => 'eaaea4098be1c90c8285543e1356a09c8aa5c8da', 67 | ), 68 | 'tidyphp/tidyphp' => 69 | array ( 70 | 'pretty_version' => '1.0.0+no-version-set', 71 | 'version' => '1.0.0.0', 72 | 'aliases' => 73 | array ( 74 | ), 75 | 'reference' => NULL, 76 | ), 77 | 'vlucas/phpdotenv' => 78 | array ( 79 | 'pretty_version' => 'v5.3.1', 80 | 'version' => '5.3.1.0', 81 | 'aliases' => 82 | array ( 83 | ), 84 | 'reference' => 'accaddf133651d4b5cf81a119f25296736ffc850', 85 | ), 86 | ), 87 | ); 88 | -------------------------------------------------------------------------------- /vendor/composer/platform_check.php: -------------------------------------------------------------------------------- 1 | = 70205)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; 20 | } 21 | } 22 | trigger_error( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 | E_USER_ERROR 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Graham Campbell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graham-campbell/result-type", 3 | "description": "An Implementation Of The Result Type", 4 | "keywords": ["result", "result-type", "Result", "Result Type", "Result-Type", "Graham Campbell", "GrahamCampbell"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Graham Campbell", 9 | "email": "hello@gjcampbell.co.uk" 10 | } 11 | ], 12 | "require": { 13 | "php": "^7.0 || ^8.0", 14 | "phpoption/phpoption": "^1.8" 15 | }, 16 | "require-dev": { 17 | "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "GrahamCampbell\\ResultType\\": "src/" 22 | } 23 | }, 24 | "autoload-dev": { 25 | "psr-4": { 26 | "GrahamCampbell\\Tests\\ResultType\\": "tests/" 27 | } 28 | }, 29 | "config": { 30 | "preferred-install": "dist" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/src/Error.php: -------------------------------------------------------------------------------- 1 | 9 | * 10 | * For the full copyright and license information, please view the LICENSE 11 | * file that was distributed with this source code. 12 | */ 13 | 14 | namespace GrahamCampbell\ResultType; 15 | 16 | use PhpOption\None; 17 | use PhpOption\Some; 18 | 19 | /** 20 | * @template T 21 | * @template E 22 | * @extends \GrahamCampbell\ResultType\Result 23 | */ 24 | final class Error extends Result 25 | { 26 | /** 27 | * @var E 28 | */ 29 | private $value; 30 | 31 | /** 32 | * Internal constructor for an error value. 33 | * 34 | * @param E $value 35 | * 36 | * @return void 37 | */ 38 | private function __construct($value) 39 | { 40 | $this->value = $value; 41 | } 42 | 43 | /** 44 | * Create a new error value. 45 | * 46 | * @template F 47 | * 48 | * @param F $value 49 | * 50 | * @return \GrahamCampbell\ResultType\Result 51 | */ 52 | public static function create($value) 53 | { 54 | return new self($value); 55 | } 56 | 57 | /** 58 | * Get the success option value. 59 | * 60 | * @return \PhpOption\Option 61 | */ 62 | public function success() 63 | { 64 | return None::create(); 65 | } 66 | 67 | /** 68 | * Map over the success value. 69 | * 70 | * @template S 71 | * 72 | * @param callable(T):S $f 73 | * 74 | * @return \GrahamCampbell\ResultType\Result 75 | */ 76 | public function map(callable $f) 77 | { 78 | return self::create($this->value); 79 | } 80 | 81 | /** 82 | * Flat map over the success value. 83 | * 84 | * @template S 85 | * @template F 86 | * 87 | * @param callable(T):\GrahamCampbell\ResultType\Result $f 88 | * 89 | * @return \GrahamCampbell\ResultType\Result 90 | */ 91 | public function flatMap(callable $f) 92 | { 93 | /** @var \GrahamCampbell\ResultType\Result */ 94 | return self::create($this->value); 95 | } 96 | 97 | /** 98 | * Get the error option value. 99 | * 100 | * @return \PhpOption\Option 101 | */ 102 | public function error() 103 | { 104 | return Some::create($this->value); 105 | } 106 | 107 | /** 108 | * Map over the error value. 109 | * 110 | * @template F 111 | * 112 | * @param callable(E):F $f 113 | * 114 | * @return \GrahamCampbell\ResultType\Result 115 | */ 116 | public function mapError(callable $f) 117 | { 118 | return self::create($f($this->value)); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/src/Result.php: -------------------------------------------------------------------------------- 1 | 9 | * 10 | * For the full copyright and license information, please view the LICENSE 11 | * file that was distributed with this source code. 12 | */ 13 | 14 | namespace GrahamCampbell\ResultType; 15 | 16 | /** 17 | * @template T 18 | * @template E 19 | */ 20 | abstract class Result 21 | { 22 | /** 23 | * Get the success option value. 24 | * 25 | * @return \PhpOption\Option 26 | */ 27 | abstract public function success(); 28 | 29 | /** 30 | * Map over the success value. 31 | * 32 | * @template S 33 | * 34 | * @param callable(T):S $f 35 | * 36 | * @return \GrahamCampbell\ResultType\Result 37 | */ 38 | abstract public function map(callable $f); 39 | 40 | /** 41 | * Flat map over the success value. 42 | * 43 | * @template S 44 | * @template F 45 | * 46 | * @param callable(T):\GrahamCampbell\ResultType\Result $f 47 | * 48 | * @return \GrahamCampbell\ResultType\Result 49 | */ 50 | abstract public function flatMap(callable $f); 51 | 52 | /** 53 | * Get the error option value. 54 | * 55 | * @return \PhpOption\Option 56 | */ 57 | abstract public function error(); 58 | 59 | /** 60 | * Map over the error value. 61 | * 62 | * @template F 63 | * 64 | * @param callable(E):F $f 65 | * 66 | * @return \GrahamCampbell\ResultType\Result 67 | */ 68 | abstract public function mapError(callable $f); 69 | } 70 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/src/Success.php: -------------------------------------------------------------------------------- 1 | 9 | * 10 | * For the full copyright and license information, please view the LICENSE 11 | * file that was distributed with this source code. 12 | */ 13 | 14 | namespace GrahamCampbell\ResultType; 15 | 16 | use PhpOption\None; 17 | use PhpOption\Some; 18 | 19 | /** 20 | * @template T 21 | * @template E 22 | * @extends \GrahamCampbell\ResultType\Result 23 | */ 24 | final class Success extends Result 25 | { 26 | /** 27 | * @var T 28 | */ 29 | private $value; 30 | 31 | /** 32 | * Internal constructor for a success value. 33 | * 34 | * @param T $value 35 | * 36 | * @return void 37 | */ 38 | private function __construct($value) 39 | { 40 | $this->value = $value; 41 | } 42 | 43 | /** 44 | * Create a new error value. 45 | * 46 | * @template S 47 | * 48 | * @param S $value 49 | * 50 | * @return \GrahamCampbell\ResultType\Result 51 | */ 52 | public static function create($value) 53 | { 54 | return new self($value); 55 | } 56 | 57 | /** 58 | * Get the success option value. 59 | * 60 | * @return \PhpOption\Option 61 | */ 62 | public function success() 63 | { 64 | return Some::create($this->value); 65 | } 66 | 67 | /** 68 | * Map over the success value. 69 | * 70 | * @template S 71 | * 72 | * @param callable(T):S $f 73 | * 74 | * @return \GrahamCampbell\ResultType\Result 75 | */ 76 | public function map(callable $f) 77 | { 78 | return self::create($f($this->value)); 79 | } 80 | 81 | /** 82 | * Flat map over the success value. 83 | * 84 | * @template S 85 | * @template F 86 | * 87 | * @param callable(T):\GrahamCampbell\ResultType\Result $f 88 | * 89 | * @return \GrahamCampbell\ResultType\Result 90 | */ 91 | public function flatMap(callable $f) 92 | { 93 | return $f($this->value); 94 | } 95 | 96 | /** 97 | * Get the error option value. 98 | * 99 | * @return \PhpOption\Option 100 | */ 101 | public function error() 102 | { 103 | return None::create(); 104 | } 105 | 106 | /** 107 | * Map over the error value. 108 | * 109 | * @template F 110 | * 111 | * @param callable(E):F $f 112 | * 113 | * @return \GrahamCampbell\ResultType\Result 114 | */ 115 | public function mapError(callable $f) 116 | { 117 | return self::create($this->value); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /vendor/phpoption/phpoption/Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base update 3 | @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base bin all update 4 | 5 | phpunit: 6 | @rm -f bootstrap/cache/*.php && docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:7.4-cli 7 | 8 | phpstan-analyze-src: 9 | @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze src -c phpstan.src.neon.dist 10 | 11 | phpstan-analyze-tests: 12 | @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze tests -c phpstan.tests.neon.dist 13 | 14 | psalm-analyze: 15 | @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli 16 | 17 | psalm-show-info: 18 | @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm .phar--rm registry.gitlab.com/grahamcampbell/php:7.4-cli --show-info=true 19 | 20 | test: phpunit phpstan-analyze-src phpstan-analyze-tests psalm-analyze 21 | 22 | clean: 23 | @rm -rf .phpunit.result.cache composer.lock vendor vendor-bin/*/composer.lock vendor-bin/*/vendor 24 | -------------------------------------------------------------------------------- /vendor/phpoption/phpoption/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phpoption/phpoption", 3 | "description": "Option Type for PHP", 4 | "keywords": ["php", "option", "language", "type"], 5 | "license": "Apache-2.0", 6 | "authors": [ 7 | { 8 | "name": "Johannes M. Schmitt", 9 | "email": "schmittjoh@gmail.com" 10 | }, 11 | { 12 | "name": "Graham Campbell", 13 | "email": "hello@gjcampbell.co.uk" 14 | } 15 | ], 16 | "require": { 17 | "php": "^7.0 || ^8.0" 18 | }, 19 | "require-dev": { 20 | "bamarni/composer-bin-plugin": "^1.4.1", 21 | "phpunit/phpunit": "^6.5.14 || ^7.0.20 || ^8.5.19 || ^9.5.8" 22 | }, 23 | "autoload": { 24 | "psr-4": { 25 | "PhpOption\\": "src/PhpOption/" 26 | } 27 | }, 28 | "autoload-dev": { 29 | "psr-4": { 30 | "PhpOption\\Tests\\": "tests/PhpOption/Tests/" 31 | } 32 | }, 33 | "config": { 34 | "preferred-install": "dist" 35 | }, 36 | "extra": { 37 | "branch-alias": { 38 | "dev-master": "1.8-dev" 39 | } 40 | }, 41 | "minimum-stability": "dev", 42 | "prefer-stable": true 43 | } 44 | -------------------------------------------------------------------------------- /vendor/phpoption/phpoption/src/PhpOption/None.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | namespace PhpOption; 20 | 21 | use EmptyIterator; 22 | 23 | /** 24 | * @extends Option 25 | */ 26 | final class None extends Option 27 | { 28 | /** @var None|null */ 29 | private static $instance; 30 | 31 | /** 32 | * @return None 33 | */ 34 | public static function create(): self 35 | { 36 | if (null === self::$instance) { 37 | self::$instance = new self(); 38 | } 39 | 40 | return self::$instance; 41 | } 42 | 43 | public function get() 44 | { 45 | throw new \RuntimeException('None has no value.'); 46 | } 47 | 48 | public function getOrCall($callable) 49 | { 50 | return $callable(); 51 | } 52 | 53 | public function getOrElse($default) 54 | { 55 | return $default; 56 | } 57 | 58 | public function getOrThrow(\Exception $ex) 59 | { 60 | throw $ex; 61 | } 62 | 63 | public function isEmpty(): bool 64 | { 65 | return true; 66 | } 67 | 68 | public function isDefined(): bool 69 | { 70 | return false; 71 | } 72 | 73 | public function orElse(Option $else) 74 | { 75 | return $else; 76 | } 77 | 78 | public function ifDefined($callable) 79 | { 80 | // Just do nothing in that case. 81 | } 82 | 83 | public function forAll($callable) 84 | { 85 | return $this; 86 | } 87 | 88 | public function map($callable) 89 | { 90 | return $this; 91 | } 92 | 93 | public function flatMap($callable) 94 | { 95 | return $this; 96 | } 97 | 98 | public function filter($callable) 99 | { 100 | return $this; 101 | } 102 | 103 | public function filterNot($callable) 104 | { 105 | return $this; 106 | } 107 | 108 | public function select($value) 109 | { 110 | return $this; 111 | } 112 | 113 | public function reject($value) 114 | { 115 | return $this; 116 | } 117 | 118 | public function getIterator(): EmptyIterator 119 | { 120 | return new EmptyIterator(); 121 | } 122 | 123 | public function foldLeft($initialValue, $callable) 124 | { 125 | return $initialValue; 126 | } 127 | 128 | public function foldRight($initialValue, $callable) 129 | { 130 | return $initialValue; 131 | } 132 | 133 | private function __construct() 134 | { 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018-2019 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Ctype 2 | ======================== 3 | 4 | This component provides `ctype_*` functions to users who run php versions without the ctype extension. 5 | 6 | More information can be found in the 7 | [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). 8 | 9 | License 10 | ======= 11 | 12 | This library is released under the [MIT license](LICENSE). 13 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/bootstrap.php: -------------------------------------------------------------------------------- 1 | 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 | use Symfony\Polyfill\Ctype as p; 13 | 14 | if (\PHP_VERSION_ID >= 80000) { 15 | return require __DIR__.'/bootstrap80.php'; 16 | } 17 | 18 | if (!function_exists('ctype_alnum')) { 19 | function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } 20 | } 21 | if (!function_exists('ctype_alpha')) { 22 | function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } 23 | } 24 | if (!function_exists('ctype_cntrl')) { 25 | function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } 26 | } 27 | if (!function_exists('ctype_digit')) { 28 | function ctype_digit($text) { return p\Ctype::ctype_digit($text); } 29 | } 30 | if (!function_exists('ctype_graph')) { 31 | function ctype_graph($text) { return p\Ctype::ctype_graph($text); } 32 | } 33 | if (!function_exists('ctype_lower')) { 34 | function ctype_lower($text) { return p\Ctype::ctype_lower($text); } 35 | } 36 | if (!function_exists('ctype_print')) { 37 | function ctype_print($text) { return p\Ctype::ctype_print($text); } 38 | } 39 | if (!function_exists('ctype_punct')) { 40 | function ctype_punct($text) { return p\Ctype::ctype_punct($text); } 41 | } 42 | if (!function_exists('ctype_space')) { 43 | function ctype_space($text) { return p\Ctype::ctype_space($text); } 44 | } 45 | if (!function_exists('ctype_upper')) { 46 | function ctype_upper($text) { return p\Ctype::ctype_upper($text); } 47 | } 48 | if (!function_exists('ctype_xdigit')) { 49 | function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/bootstrap80.php: -------------------------------------------------------------------------------- 1 | 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 | use Symfony\Polyfill\Ctype as p; 13 | 14 | if (!function_exists('ctype_alnum')) { 15 | function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } 16 | } 17 | if (!function_exists('ctype_alpha')) { 18 | function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } 19 | } 20 | if (!function_exists('ctype_cntrl')) { 21 | function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } 22 | } 23 | if (!function_exists('ctype_digit')) { 24 | function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } 25 | } 26 | if (!function_exists('ctype_graph')) { 27 | function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } 28 | } 29 | if (!function_exists('ctype_lower')) { 30 | function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } 31 | } 32 | if (!function_exists('ctype_print')) { 33 | function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } 34 | } 35 | if (!function_exists('ctype_punct')) { 36 | function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } 37 | } 38 | if (!function_exists('ctype_space')) { 39 | function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } 40 | } 41 | if (!function_exists('ctype_upper')) { 42 | function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } 43 | } 44 | if (!function_exists('ctype_xdigit')) { 45 | function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-ctype", 3 | "type": "library", 4 | "description": "Symfony polyfill for ctype functions", 5 | "keywords": ["polyfill", "compatibility", "portable", "ctype"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Gert de Pagter", 11 | "email": "BackEndTea@gmail.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.1" 20 | }, 21 | "autoload": { 22 | "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, 23 | "files": [ "bootstrap.php" ] 24 | }, 25 | "suggest": { 26 | "ext-ctype": "For best performance" 27 | }, 28 | "minimum-stability": "dev", 29 | "extra": { 30 | "branch-alias": { 31 | "dev-main": "1.23-dev" 32 | }, 33 | "thanks": { 34 | "name": "symfony/polyfill", 35 | "url": "https://github.com/symfony/polyfill" 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2019 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Mbstring 2 | =========================== 3 | 4 | This component provides a partial, native PHP implementation for the 5 | [Mbstring](https://php.net/mbstring) extension. 6 | 7 | More information can be found in the 8 | [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). 9 | 10 | License 11 | ======= 12 | 13 | This library is released under the [MIT license](LICENSE). 14 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-mbstring", 3 | "type": "library", 4 | "description": "Symfony polyfill for the Mbstring extension", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.1" 20 | }, 21 | "autoload": { 22 | "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, 23 | "files": [ "bootstrap.php" ] 24 | }, 25 | "suggest": { 26 | "ext-mbstring": "For best performance" 27 | }, 28 | "minimum-stability": "dev", 29 | "extra": { 30 | "branch-alias": { 31 | "dev-main": "1.23-dev" 32 | }, 33 | "thanks": { 34 | "name": "symfony/polyfill", 35 | "url": "https://github.com/symfony/polyfill" 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Php80 2 | ======================== 3 | 4 | This component provides features added to PHP 8.0 core: 5 | 6 | - `Stringable` interface 7 | - [`fdiv`](https://php.net/fdiv) 8 | - `ValueError` class 9 | - `UnhandledMatchError` class 10 | - `FILTER_VALIDATE_BOOL` constant 11 | - [`get_debug_type`](https://php.net/get_debug_type) 12 | - [`preg_last_error_msg`](https://php.net/preg_last_error_msg) 13 | - [`str_contains`](https://php.net/str_contains) 14 | - [`str_starts_with`](https://php.net/str_starts_with) 15 | - [`str_ends_with`](https://php.net/str_ends_with) 16 | - [`get_resource_id`](https://php.net/get_resource_id) 17 | 18 | More information can be found in the 19 | [main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). 20 | 21 | License 22 | ======= 23 | 24 | This library is released under the [MIT license](LICENSE). 25 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php: -------------------------------------------------------------------------------- 1 | flags = $flags; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php: -------------------------------------------------------------------------------- 1 | 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 | use Symfony\Polyfill\Php80 as p; 13 | 14 | if (\PHP_VERSION_ID >= 80000) { 15 | return; 16 | } 17 | 18 | if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { 19 | define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); 20 | } 21 | 22 | if (!function_exists('fdiv')) { 23 | function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } 24 | } 25 | if (!function_exists('preg_last_error_msg')) { 26 | function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } 27 | } 28 | if (!function_exists('str_contains')) { 29 | function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } 30 | } 31 | if (!function_exists('str_starts_with')) { 32 | function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } 33 | } 34 | if (!function_exists('str_ends_with')) { 35 | function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } 36 | } 37 | if (!function_exists('get_debug_type')) { 38 | function get_debug_type($value): string { return p\Php80::get_debug_type($value); } 39 | } 40 | if (!function_exists('get_resource_id')) { 41 | function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-php80", 3 | "type": "library", 4 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Ion Bazan", 11 | "email": "ion.bazan@gmail.com" 12 | }, 13 | { 14 | "name": "Nicolas Grekas", 15 | "email": "p@tchwork.com" 16 | }, 17 | { 18 | "name": "Symfony Community", 19 | "homepage": "https://symfony.com/contributors" 20 | } 21 | ], 22 | "require": { 23 | "php": ">=7.1" 24 | }, 25 | "autoload": { 26 | "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, 27 | "files": [ "bootstrap.php" ], 28 | "classmap": [ "Resources/stubs" ] 29 | }, 30 | "minimum-stability": "dev", 31 | "extra": { 32 | "branch-alias": { 33 | "dev-main": "1.23-dev" 34 | }, 35 | "thanks": { 36 | "name": "symfony/polyfill", 37 | "url": "https://github.com/symfony/polyfill" 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | 5.2.0 5 | ----- 6 | 7 | * added support for PHPUnit `--colors` option 8 | * added `VAR_DUMPER_FORMAT=server` env var value support 9 | * prevent replacing the handler when the `VAR_DUMPER_FORMAT` env var is set 10 | 11 | 5.1.0 12 | ----- 13 | 14 | * added `RdKafka` support 15 | 16 | 4.4.0 17 | ----- 18 | 19 | * added `VarDumperTestTrait::setUpVarDumper()` and `VarDumperTestTrait::tearDownVarDumper()` 20 | to configure casters & flags to use in tests 21 | * added `ImagineCaster` and infrastructure to dump images 22 | * added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data 23 | * added `UuidCaster` 24 | * made all casters final 25 | * added support for the `NO_COLOR` env var (https://no-color.org/) 26 | 27 | 4.3.0 28 | ----- 29 | 30 | * added `DsCaster` to support dumping the contents of data structures from the Ds extension 31 | 32 | 4.2.0 33 | ----- 34 | 35 | * support selecting the format to use by setting the environment variable `VAR_DUMPER_FORMAT` to `html` or `cli` 36 | 37 | 4.1.0 38 | ----- 39 | 40 | * added a `ServerDumper` to send serialized Data clones to a server 41 | * added a `ServerDumpCommand` and `DumpServer` to run a server collecting 42 | and displaying dumps on a single place with multiple formats support 43 | * added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support 44 | 45 | 4.0.0 46 | ----- 47 | 48 | * support for passing `\ReflectionClass` instances to the `Caster::castObject()` 49 | method has been dropped, pass class names as strings instead 50 | * the `Data::getRawData()` method has been removed 51 | * the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0` 52 | argument and moves `$message = ''` argument at 4th position. 53 | * the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0` 54 | argument and moves `$message = ''` argument at 4th position. 55 | 56 | 3.4.0 57 | ----- 58 | 59 | * added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth 60 | * deprecated `MongoCaster` 61 | 62 | 2.7.0 63 | ----- 64 | 65 | * deprecated `Cloner\Data::getLimitedClone()`. Use `withMaxDepth`, `withMaxItemsPerDepth` or `withRefHandles` instead. 66 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ArgsStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a list of function arguments. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ArgsStub extends EnumStub 22 | { 23 | private static $parameters = []; 24 | 25 | public function __construct(array $args, string $function, ?string $class) 26 | { 27 | [$variadic, $params] = self::getParameters($function, $class); 28 | 29 | $values = []; 30 | foreach ($args as $k => $v) { 31 | $values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v; 32 | } 33 | if (null === $params) { 34 | parent::__construct($values, false); 35 | 36 | return; 37 | } 38 | if (\count($values) < \count($params)) { 39 | $params = \array_slice($params, 0, \count($values)); 40 | } elseif (\count($values) > \count($params)) { 41 | $values[] = new EnumStub(array_splice($values, \count($params)), false); 42 | $params[] = $variadic; 43 | } 44 | if (['...'] === $params) { 45 | $this->dumpKeys = false; 46 | $this->value = $values[0]->value; 47 | } else { 48 | $this->value = array_combine($params, $values); 49 | } 50 | } 51 | 52 | private static function getParameters(string $function, ?string $class): array 53 | { 54 | if (isset(self::$parameters[$k = $class.'::'.$function])) { 55 | return self::$parameters[$k]; 56 | } 57 | 58 | try { 59 | $r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function); 60 | } catch (\ReflectionException $e) { 61 | return [null, null]; 62 | } 63 | 64 | $variadic = '...'; 65 | $params = []; 66 | foreach ($r->getParameters() as $v) { 67 | $k = '$'.$v->name; 68 | if ($v->isPassedByReference()) { 69 | $k = '&'.$k; 70 | } 71 | if ($v->isVariadic()) { 72 | $variadic .= $k; 73 | } else { 74 | $params[] = $k; 75 | } 76 | } 77 | 78 | return self::$parameters[$k] = [$variadic, $params]; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ConstStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a PHP constant and its value. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ConstStub extends Stub 22 | { 23 | public function __construct(string $name, $value = null) 24 | { 25 | $this->class = $name; 26 | $this->value = 1 < \func_num_args() ? $value : $name; 27 | } 28 | 29 | /** 30 | * @return string 31 | */ 32 | public function __toString() 33 | { 34 | return (string) $this->value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/CutArrayStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a cut array. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class CutArrayStub extends CutStub 20 | { 21 | public $preservedSubset; 22 | 23 | public function __construct(array $value, array $preservedKeys) 24 | { 25 | parent::__construct($value); 26 | 27 | $this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys)); 28 | $this->cut -= \count($this->preservedSubset); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/CutStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents the main properties of a PHP variable, pre-casted by a caster. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class CutStub extends Stub 22 | { 23 | public function __construct($value) 24 | { 25 | $this->value = $value; 26 | 27 | switch (\gettype($value)) { 28 | case 'object': 29 | $this->type = self::TYPE_OBJECT; 30 | $this->class = \get_class($value); 31 | 32 | if ($value instanceof \Closure) { 33 | ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE); 34 | } 35 | 36 | $this->cut = -1; 37 | break; 38 | 39 | case 'array': 40 | $this->type = self::TYPE_ARRAY; 41 | $this->class = self::ARRAY_ASSOC; 42 | $this->cut = $this->value = \count($value); 43 | break; 44 | 45 | case 'resource': 46 | case 'unknown type': 47 | case 'resource (closed)': 48 | $this->type = self::TYPE_RESOURCE; 49 | $this->handle = (int) $value; 50 | if ('Unknown' === $this->class = @get_resource_type($value)) { 51 | $this->class = 'Closed'; 52 | } 53 | $this->cut = -1; 54 | break; 55 | 56 | case 'string': 57 | $this->type = self::TYPE_STRING; 58 | $this->class = preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY; 59 | $this->cut = self::STRING_BINARY === $this->class ? \strlen($value) : mb_strlen($value, 'UTF-8'); 60 | $this->value = ''; 61 | break; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DoctrineCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Doctrine\Common\Proxy\Proxy as CommonProxy; 15 | use Doctrine\ORM\PersistentCollection; 16 | use Doctrine\ORM\Proxy\Proxy as OrmProxy; 17 | use Symfony\Component\VarDumper\Cloner\Stub; 18 | 19 | /** 20 | * Casts Doctrine related classes to array representation. 21 | * 22 | * @author Nicolas Grekas 23 | * 24 | * @final 25 | */ 26 | class DoctrineCaster 27 | { 28 | public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested) 29 | { 30 | foreach (['__cloner__', '__initializer__'] as $k) { 31 | if (\array_key_exists($k, $a)) { 32 | unset($a[$k]); 33 | ++$stub->cut; 34 | } 35 | } 36 | 37 | return $a; 38 | } 39 | 40 | public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested) 41 | { 42 | foreach (['_entityPersister', '_identifier'] as $k) { 43 | if (\array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) { 44 | unset($a[$k]); 45 | ++$stub->cut; 46 | } 47 | } 48 | 49 | return $a; 50 | } 51 | 52 | public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested) 53 | { 54 | foreach (['snapshot', 'association', 'typeClass'] as $k) { 55 | if (\array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) { 56 | $a[$k] = new CutStub($a[$k]); 57 | } 58 | } 59 | 60 | return $a; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DsCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Ds\Collection; 15 | use Ds\Map; 16 | use Ds\Pair; 17 | use Symfony\Component\VarDumper\Cloner\Stub; 18 | 19 | /** 20 | * Casts Ds extension classes to array representation. 21 | * 22 | * @author Jáchym Toušek 23 | * 24 | * @final 25 | */ 26 | class DsCaster 27 | { 28 | public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested): array 29 | { 30 | $a[Caster::PREFIX_VIRTUAL.'count'] = $c->count(); 31 | $a[Caster::PREFIX_VIRTUAL.'capacity'] = $c->capacity(); 32 | 33 | if (!$c instanceof Map) { 34 | $a += $c->toArray(); 35 | } 36 | 37 | return $a; 38 | } 39 | 40 | public static function castMap(Map $c, array $a, Stub $stub, bool $isNested): array 41 | { 42 | foreach ($c as $k => $v) { 43 | $a[] = new DsPairStub($k, $v); 44 | } 45 | 46 | return $a; 47 | } 48 | 49 | public static function castPair(Pair $c, array $a, Stub $stub, bool $isNested): array 50 | { 51 | foreach ($c->toArray() as $k => $v) { 52 | $a[Caster::PREFIX_VIRTUAL.$k] = $v; 53 | } 54 | 55 | return $a; 56 | } 57 | 58 | public static function castPairStub(DsPairStub $c, array $a, Stub $stub, bool $isNested): array 59 | { 60 | if ($isNested) { 61 | $stub->class = Pair::class; 62 | $stub->value = null; 63 | $stub->handle = 0; 64 | 65 | $a = $c->value; 66 | } 67 | 68 | return $a; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DsPairStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * @author Nicolas Grekas 18 | */ 19 | class DsPairStub extends Stub 20 | { 21 | public function __construct($key, $value) 22 | { 23 | $this->value = [ 24 | Caster::PREFIX_VIRTUAL.'key' => $key, 25 | Caster::PREFIX_VIRTUAL.'value' => $value, 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/EnumStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents an enumeration of values. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class EnumStub extends Stub 22 | { 23 | public $dumpKeys = true; 24 | 25 | public function __construct(array $values, bool $dumpKeys = true) 26 | { 27 | $this->value = $values; 28 | $this->dumpKeys = $dumpKeys; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/FrameStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a single backtrace frame as returned by debug_backtrace() or Exception->getTrace(). 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class FrameStub extends EnumStub 20 | { 21 | public $keepArgs; 22 | public $inTraceStub; 23 | 24 | public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false) 25 | { 26 | $this->value = $frame; 27 | $this->keepArgs = $keepArgs; 28 | $this->inTraceStub = $inTraceStub; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/GmpCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts GMP objects to array representation. 18 | * 19 | * @author Hamza Amrouche 20 | * @author Nicolas Grekas 21 | * 22 | * @final 23 | */ 24 | class GmpCaster 25 | { 26 | public static function castGmp(\GMP $gmp, array $a, Stub $stub, bool $isNested, int $filter): array 27 | { 28 | $a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp)); 29 | 30 | return $a; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ImagineCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Imagine\Image\ImageInterface; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | /** 18 | * @author Grégoire Pineau 19 | */ 20 | final class ImagineCaster 21 | { 22 | public static function castImage(ImageInterface $c, array $a, Stub $stub, bool $isNested): array 23 | { 24 | $imgData = $c->get('png'); 25 | if (\strlen($imgData) > 1 * 1000 * 1000) { 26 | $a += [ 27 | Caster::PREFIX_VIRTUAL.'image' => new ConstStub($c->getSize()), 28 | ]; 29 | } else { 30 | $a += [ 31 | Caster::PREFIX_VIRTUAL.'image' => new ImgStub($imgData, 'image/png', $c->getSize()), 32 | ]; 33 | } 34 | 35 | return $a; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ImgStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * @author Grégoire Pineau 16 | */ 17 | class ImgStub extends ConstStub 18 | { 19 | public function __construct(string $data, string $contentType, string $size = '') 20 | { 21 | $this->value = ''; 22 | $this->attr['img-data'] = $data; 23 | $this->attr['img-size'] = $size; 24 | $this->attr['content-type'] = $contentType; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/MemcachedCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * @author Jan Schädlich 18 | * 19 | * @final 20 | */ 21 | class MemcachedCaster 22 | { 23 | private static $optionConstants; 24 | private static $defaultOptions; 25 | 26 | public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested) 27 | { 28 | $a += [ 29 | Caster::PREFIX_VIRTUAL.'servers' => $c->getServerList(), 30 | Caster::PREFIX_VIRTUAL.'options' => new EnumStub( 31 | self::getNonDefaultOptions($c) 32 | ), 33 | ]; 34 | 35 | return $a; 36 | } 37 | 38 | private static function getNonDefaultOptions(\Memcached $c): array 39 | { 40 | self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions(); 41 | self::$optionConstants = self::$optionConstants ?? self::getOptionConstants(); 42 | 43 | $nonDefaultOptions = []; 44 | foreach (self::$optionConstants as $constantKey => $value) { 45 | if (self::$defaultOptions[$constantKey] !== $option = $c->getOption($value)) { 46 | $nonDefaultOptions[$constantKey] = $option; 47 | } 48 | } 49 | 50 | return $nonDefaultOptions; 51 | } 52 | 53 | private static function discoverDefaultOptions(): array 54 | { 55 | $defaultMemcached = new \Memcached(); 56 | $defaultMemcached->addServer('127.0.0.1', 11211); 57 | 58 | $defaultOptions = []; 59 | self::$optionConstants = self::$optionConstants ?? self::getOptionConstants(); 60 | 61 | foreach (self::$optionConstants as $constantKey => $value) { 62 | $defaultOptions[$constantKey] = $defaultMemcached->getOption($value); 63 | } 64 | 65 | return $defaultOptions; 66 | } 67 | 68 | private static function getOptionConstants(): array 69 | { 70 | $reflectedMemcached = new \ReflectionClass(\Memcached::class); 71 | 72 | $optionConstants = []; 73 | foreach ($reflectedMemcached->getConstants() as $constantKey => $value) { 74 | if (str_starts_with($constantKey, 'OPT_')) { 75 | $optionConstants[$constantKey] = $value; 76 | } 77 | } 78 | 79 | return $optionConstants; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use ProxyManager\Proxy\ProxyInterface; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | /** 18 | * @author Nicolas Grekas 19 | * 20 | * @final 21 | */ 22 | class ProxyManagerCaster 23 | { 24 | public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested) 25 | { 26 | if ($parent = get_parent_class($c)) { 27 | $stub->class .= ' - '.$parent; 28 | } 29 | $stub->class .= '@proxy'; 30 | 31 | return $a; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ResourceCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts common resource types to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class ResourceCaster 24 | { 25 | /** 26 | * @param \CurlHandle|resource $h 27 | * 28 | * @return array 29 | */ 30 | public static function castCurl($h, array $a, Stub $stub, bool $isNested) 31 | { 32 | return curl_getinfo($h); 33 | } 34 | 35 | public static function castDba($dba, array $a, Stub $stub, bool $isNested) 36 | { 37 | $list = dba_list(); 38 | $a['file'] = $list[(int) $dba]; 39 | 40 | return $a; 41 | } 42 | 43 | public static function castProcess($process, array $a, Stub $stub, bool $isNested) 44 | { 45 | return proc_get_status($process); 46 | } 47 | 48 | public static function castStream($stream, array $a, Stub $stub, bool $isNested) 49 | { 50 | $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); 51 | if ($a['uri'] ?? false) { 52 | $a['uri'] = new LinkStub($a['uri']); 53 | } 54 | 55 | return $a; 56 | } 57 | 58 | public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested) 59 | { 60 | return @stream_context_get_params($stream) ?: $a; 61 | } 62 | 63 | public static function castGd($gd, array $a, Stub $stub, bool $isNested) 64 | { 65 | $a['size'] = imagesx($gd).'x'.imagesy($gd); 66 | $a['trueColor'] = imageistruecolor($gd); 67 | 68 | return $a; 69 | } 70 | 71 | public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested) 72 | { 73 | $a['host'] = mysql_get_host_info($h); 74 | $a['protocol'] = mysql_get_proto_info($h); 75 | $a['server'] = mysql_get_server_info($h); 76 | 77 | return $a; 78 | } 79 | 80 | public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested) 81 | { 82 | $stub->cut = -1; 83 | $info = openssl_x509_parse($h, false); 84 | 85 | $pin = openssl_pkey_get_public($h); 86 | $pin = openssl_pkey_get_details($pin)['key']; 87 | $pin = \array_slice(explode("\n", $pin), 1, -2); 88 | $pin = base64_decode(implode('', $pin)); 89 | $pin = base64_encode(hash('sha256', $pin, true)); 90 | 91 | $a += [ 92 | 'subject' => new EnumStub(array_intersect_key($info['subject'], ['organizationName' => true, 'commonName' => true])), 93 | 'issuer' => new EnumStub(array_intersect_key($info['issuer'], ['organizationName' => true, 'commonName' => true])), 94 | 'expiry' => new ConstStub(date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']), 95 | 'fingerprint' => new EnumStub([ 96 | 'md5' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'md5')), 2, ':', true)), 97 | 'sha1' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha1')), 2, ':', true)), 98 | 'sha256' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha256')), 2, ':', true)), 99 | 'pin-sha256' => new ConstStub($pin), 100 | ]), 101 | ]; 102 | 103 | return $a; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/StubCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts a caster's Stub. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class StubCaster 24 | { 25 | public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested) 26 | { 27 | if ($isNested) { 28 | $stub->type = $c->type; 29 | $stub->class = $c->class; 30 | $stub->value = $c->value; 31 | $stub->handle = $c->handle; 32 | $stub->cut = $c->cut; 33 | $stub->attr = $c->attr; 34 | 35 | if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !preg_match('//u', $c->value)) { 36 | $stub->type = Stub::TYPE_STRING; 37 | $stub->class = Stub::STRING_BINARY; 38 | } 39 | 40 | $a = []; 41 | } 42 | 43 | return $a; 44 | } 45 | 46 | public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested) 47 | { 48 | return $isNested ? $c->preservedSubset : $a; 49 | } 50 | 51 | public static function cutInternals($obj, array $a, Stub $stub, bool $isNested) 52 | { 53 | if ($isNested) { 54 | $stub->cut += \count($a); 55 | 56 | return []; 57 | } 58 | 59 | return $a; 60 | } 61 | 62 | public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested) 63 | { 64 | if ($isNested) { 65 | $stub->class = $c->dumpKeys ? '' : null; 66 | $stub->handle = 0; 67 | $stub->value = null; 68 | $stub->cut = $c->cut; 69 | $stub->attr = $c->attr; 70 | 71 | $a = []; 72 | 73 | if ($c->value) { 74 | foreach (array_keys($c->value) as $k) { 75 | $keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k; 76 | } 77 | // Preserve references with array_combine() 78 | $a = array_combine($keys, $c->value); 79 | } 80 | } 81 | 82 | return $a; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/SymfonyCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\HttpFoundation\Request; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | /** 18 | * @final 19 | */ 20 | class SymfonyCaster 21 | { 22 | private const REQUEST_GETTERS = [ 23 | 'pathInfo' => 'getPathInfo', 24 | 'requestUri' => 'getRequestUri', 25 | 'baseUrl' => 'getBaseUrl', 26 | 'basePath' => 'getBasePath', 27 | 'method' => 'getMethod', 28 | 'format' => 'getRequestFormat', 29 | ]; 30 | 31 | public static function castRequest(Request $request, array $a, Stub $stub, bool $isNested) 32 | { 33 | $clone = null; 34 | 35 | foreach (self::REQUEST_GETTERS as $prop => $getter) { 36 | $key = Caster::PREFIX_PROTECTED.$prop; 37 | if (\array_key_exists($key, $a) && null === $a[$key]) { 38 | if (null === $clone) { 39 | $clone = clone $request; 40 | } 41 | $a[Caster::PREFIX_VIRTUAL.$prop] = $clone->{$getter}(); 42 | } 43 | } 44 | 45 | return $a; 46 | } 47 | 48 | public static function castHttpClient($client, array $a, Stub $stub, bool $isNested) 49 | { 50 | $multiKey = sprintf("\0%s\0multi", \get_class($client)); 51 | if (isset($a[$multiKey])) { 52 | $a[$multiKey] = new CutStub($a[$multiKey]); 53 | } 54 | 55 | return $a; 56 | } 57 | 58 | public static function castHttpClientResponse($response, array $a, Stub $stub, bool $isNested) 59 | { 60 | $stub->cut += \count($a); 61 | $a = []; 62 | 63 | foreach ($response->getInfo() as $k => $v) { 64 | $a[Caster::PREFIX_VIRTUAL.$k] = $v; 65 | } 66 | 67 | return $a; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/TraceStub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a backtrace as returned by debug_backtrace() or Exception->getTrace(). 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class TraceStub extends Stub 22 | { 23 | public $keepArgs; 24 | public $sliceOffset; 25 | public $sliceLength; 26 | public $numberingOffset; 27 | 28 | public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) 29 | { 30 | $this->value = $trace; 31 | $this->keepArgs = $keepArgs; 32 | $this->sliceOffset = $sliceOffset; 33 | $this->sliceLength = $sliceLength; 34 | $this->numberingOffset = $numberingOffset; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/UuidCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Ramsey\Uuid\UuidInterface; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | /** 18 | * @author Grégoire Pineau 19 | */ 20 | final class UuidCaster 21 | { 22 | public static function castRamseyUuid(UuidInterface $c, array $a, Stub $stub, bool $isNested): array 23 | { 24 | $a += [ 25 | Caster::PREFIX_VIRTUAL.'uuid' => (string) $c, 26 | ]; 27 | 28 | return $a; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/XmlReaderCaster.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace Symfony\Component\VarDumper\Caster; 12 | 13 | use Symfony\Component\VarDumper\Cloner\Stub; 14 | 15 | /** 16 | * Casts XmlReader class to array representation. 17 | * 18 | * @author Baptiste Clavié 19 | * 20 | * @final 21 | */ 22 | class XmlReaderCaster 23 | { 24 | private const NODE_TYPES = [ 25 | \XMLReader::NONE => 'NONE', 26 | \XMLReader::ELEMENT => 'ELEMENT', 27 | \XMLReader::ATTRIBUTE => 'ATTRIBUTE', 28 | \XMLReader::TEXT => 'TEXT', 29 | \XMLReader::CDATA => 'CDATA', 30 | \XMLReader::ENTITY_REF => 'ENTITY_REF', 31 | \XMLReader::ENTITY => 'ENTITY', 32 | \XMLReader::PI => 'PI (Processing Instruction)', 33 | \XMLReader::COMMENT => 'COMMENT', 34 | \XMLReader::DOC => 'DOC', 35 | \XMLReader::DOC_TYPE => 'DOC_TYPE', 36 | \XMLReader::DOC_FRAGMENT => 'DOC_FRAGMENT', 37 | \XMLReader::NOTATION => 'NOTATION', 38 | \XMLReader::WHITESPACE => 'WHITESPACE', 39 | \XMLReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE', 40 | \XMLReader::END_ELEMENT => 'END_ELEMENT', 41 | \XMLReader::END_ENTITY => 'END_ENTITY', 42 | \XMLReader::XML_DECLARATION => 'XML_DECLARATION', 43 | ]; 44 | 45 | public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested) 46 | { 47 | $props = Caster::PREFIX_VIRTUAL.'parserProperties'; 48 | $info = [ 49 | 'localName' => $reader->localName, 50 | 'prefix' => $reader->prefix, 51 | 'nodeType' => new ConstStub(self::NODE_TYPES[$reader->nodeType], $reader->nodeType), 52 | 'depth' => $reader->depth, 53 | 'isDefault' => $reader->isDefault, 54 | 'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement, 55 | 'xmlLang' => $reader->xmlLang, 56 | 'attributeCount' => $reader->attributeCount, 57 | 'value' => $reader->value, 58 | 'namespaceURI' => $reader->namespaceURI, 59 | 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI, 60 | $props => [ 61 | 'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD), 62 | 'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS), 63 | 'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE), 64 | 'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES), 65 | ], 66 | ]; 67 | 68 | if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, [], $count)) { 69 | $info[$props] = new EnumStub($info[$props]); 70 | $info[$props]->cut = $count; 71 | } 72 | 73 | $info = Caster::filter($info, Caster::EXCLUDE_EMPTY, [], $count); 74 | // +2 because hasValue and hasAttributes are always filtered 75 | $stub->cut += $count + 2; 76 | 77 | return $a + $info; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/XmlResourceCaster.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts XML resources to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | * 21 | * @final 22 | */ 23 | class XmlResourceCaster 24 | { 25 | private const XML_ERRORS = [ 26 | \XML_ERROR_NONE => 'XML_ERROR_NONE', 27 | \XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY', 28 | \XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX', 29 | \XML_ERROR_NO_ELEMENTS => 'XML_ERROR_NO_ELEMENTS', 30 | \XML_ERROR_INVALID_TOKEN => 'XML_ERROR_INVALID_TOKEN', 31 | \XML_ERROR_UNCLOSED_TOKEN => 'XML_ERROR_UNCLOSED_TOKEN', 32 | \XML_ERROR_PARTIAL_CHAR => 'XML_ERROR_PARTIAL_CHAR', 33 | \XML_ERROR_TAG_MISMATCH => 'XML_ERROR_TAG_MISMATCH', 34 | \XML_ERROR_DUPLICATE_ATTRIBUTE => 'XML_ERROR_DUPLICATE_ATTRIBUTE', 35 | \XML_ERROR_JUNK_AFTER_DOC_ELEMENT => 'XML_ERROR_JUNK_AFTER_DOC_ELEMENT', 36 | \XML_ERROR_PARAM_ENTITY_REF => 'XML_ERROR_PARAM_ENTITY_REF', 37 | \XML_ERROR_UNDEFINED_ENTITY => 'XML_ERROR_UNDEFINED_ENTITY', 38 | \XML_ERROR_RECURSIVE_ENTITY_REF => 'XML_ERROR_RECURSIVE_ENTITY_REF', 39 | \XML_ERROR_ASYNC_ENTITY => 'XML_ERROR_ASYNC_ENTITY', 40 | \XML_ERROR_BAD_CHAR_REF => 'XML_ERROR_BAD_CHAR_REF', 41 | \XML_ERROR_BINARY_ENTITY_REF => 'XML_ERROR_BINARY_ENTITY_REF', 42 | \XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF => 'XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF', 43 | \XML_ERROR_MISPLACED_XML_PI => 'XML_ERROR_MISPLACED_XML_PI', 44 | \XML_ERROR_UNKNOWN_ENCODING => 'XML_ERROR_UNKNOWN_ENCODING', 45 | \XML_ERROR_INCORRECT_ENCODING => 'XML_ERROR_INCORRECT_ENCODING', 46 | \XML_ERROR_UNCLOSED_CDATA_SECTION => 'XML_ERROR_UNCLOSED_CDATA_SECTION', 47 | \XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING', 48 | ]; 49 | 50 | public static function castXml($h, array $a, Stub $stub, bool $isNested) 51 | { 52 | $a['current_byte_index'] = xml_get_current_byte_index($h); 53 | $a['current_column_number'] = xml_get_current_column_number($h); 54 | $a['current_line_number'] = xml_get_current_line_number($h); 55 | $a['error_code'] = xml_get_error_code($h); 56 | 57 | if (isset(self::XML_ERRORS[$a['error_code']])) { 58 | $a['error_code'] = new ConstStub(self::XML_ERRORS[$a['error_code']], $a['error_code']); 59 | } 60 | 61 | return $a; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/ClonerInterface.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * @author Nicolas Grekas 16 | */ 17 | interface ClonerInterface 18 | { 19 | /** 20 | * Clones a PHP variable. 21 | * 22 | * @param mixed $var Any PHP variable 23 | * 24 | * @return Data The cloned variable represented by a Data object 25 | */ 26 | public function cloneVar($var); 27 | } 28 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/Cursor.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * Represents the current state of a dumper while dumping. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class Cursor 20 | { 21 | public const HASH_INDEXED = Stub::ARRAY_INDEXED; 22 | public const HASH_ASSOC = Stub::ARRAY_ASSOC; 23 | public const HASH_OBJECT = Stub::TYPE_OBJECT; 24 | public const HASH_RESOURCE = Stub::TYPE_RESOURCE; 25 | 26 | public $depth = 0; 27 | public $refIndex = 0; 28 | public $softRefTo = 0; 29 | public $softRefCount = 0; 30 | public $softRefHandle = 0; 31 | public $hardRefTo = 0; 32 | public $hardRefCount = 0; 33 | public $hardRefHandle = 0; 34 | public $hashType; 35 | public $hashKey; 36 | public $hashKeyIsBinary; 37 | public $hashIndex = 0; 38 | public $hashLength = 0; 39 | public $hashCut = 0; 40 | public $stop = false; 41 | public $attr = []; 42 | public $skipChildren = false; 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/DumperInterface.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * DumperInterface used by Data objects. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | interface DumperInterface 20 | { 21 | /** 22 | * Dumps a scalar value. 23 | * 24 | * @param string $type The PHP type of the value being dumped 25 | * @param string|int|float|bool $value The scalar value being dumped 26 | */ 27 | public function dumpScalar(Cursor $cursor, string $type, $value); 28 | 29 | /** 30 | * Dumps a string. 31 | * 32 | * @param string $str The string being dumped 33 | * @param bool $bin Whether $str is UTF-8 or binary encoded 34 | * @param int $cut The number of characters $str has been cut by 35 | */ 36 | public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut); 37 | 38 | /** 39 | * Dumps while entering an hash. 40 | * 41 | * @param int $type A Cursor::HASH_* const for the type of hash 42 | * @param string|int $class The object class, resource type or array count 43 | * @param bool $hasChild When the dump of the hash has child item 44 | */ 45 | public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild); 46 | 47 | /** 48 | * Dumps while leaving an hash. 49 | * 50 | * @param int $type A Cursor::HASH_* const for the type of hash 51 | * @param string|int $class The object class, resource type or array count 52 | * @param bool $hasChild When the dump of the hash has child item 53 | * @param int $cut The number of items the hash has been cut by 54 | */ 55 | public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut); 56 | } 57 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/Stub.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * Represents the main properties of a PHP variable. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class Stub 20 | { 21 | public const TYPE_REF = 1; 22 | public const TYPE_STRING = 2; 23 | public const TYPE_ARRAY = 3; 24 | public const TYPE_OBJECT = 4; 25 | public const TYPE_RESOURCE = 5; 26 | 27 | public const STRING_BINARY = 1; 28 | public const STRING_UTF8 = 2; 29 | 30 | public const ARRAY_ASSOC = 1; 31 | public const ARRAY_INDEXED = 2; 32 | 33 | public $type = self::TYPE_REF; 34 | public $class = ''; 35 | public $value; 36 | public $cut = 0; 37 | public $handle = 0; 38 | public $refCount = 0; 39 | public $position = 0; 40 | public $attr = []; 41 | 42 | private static $defaultProperties = []; 43 | 44 | /** 45 | * @internal 46 | */ 47 | public function __sleep(): array 48 | { 49 | $properties = []; 50 | 51 | if (!isset(self::$defaultProperties[$c = static::class])) { 52 | self::$defaultProperties[$c] = get_class_vars($c); 53 | 54 | foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) { 55 | unset(self::$defaultProperties[$c][$k]); 56 | } 57 | } 58 | 59 | foreach (self::$defaultProperties[$c] as $k => $v) { 60 | if ($this->$k !== $v) { 61 | $properties[] = $k; 62 | } 63 | } 64 | 65 | return $properties; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Command\Descriptor; 13 | 14 | use Symfony\Component\Console\Formatter\OutputFormatterStyle; 15 | use Symfony\Component\Console\Input\ArrayInput; 16 | use Symfony\Component\Console\Output\OutputInterface; 17 | use Symfony\Component\Console\Style\SymfonyStyle; 18 | use Symfony\Component\VarDumper\Cloner\Data; 19 | use Symfony\Component\VarDumper\Dumper\CliDumper; 20 | 21 | /** 22 | * Describe collected data clones for cli output. 23 | * 24 | * @author Maxime Steinhausser 25 | * 26 | * @final 27 | */ 28 | class CliDescriptor implements DumpDescriptorInterface 29 | { 30 | private $dumper; 31 | private $lastIdentifier; 32 | private $supportsHref; 33 | 34 | public function __construct(CliDumper $dumper) 35 | { 36 | $this->dumper = $dumper; 37 | $this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref'); 38 | } 39 | 40 | public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void 41 | { 42 | $io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output); 43 | $this->dumper->setColors($output->isDecorated()); 44 | 45 | $rows = [['date', date('r', (int) $context['timestamp'])]]; 46 | $lastIdentifier = $this->lastIdentifier; 47 | $this->lastIdentifier = $clientId; 48 | 49 | $section = "Received from client #$clientId"; 50 | if (isset($context['request'])) { 51 | $request = $context['request']; 52 | $this->lastIdentifier = $request['identifier']; 53 | $section = sprintf('%s %s', $request['method'], $request['uri']); 54 | if ($controller = $request['controller']) { 55 | $rows[] = ['controller', rtrim($this->dumper->dump($controller, true), "\n")]; 56 | } 57 | } elseif (isset($context['cli'])) { 58 | $this->lastIdentifier = $context['cli']['identifier']; 59 | $section = '$ '.$context['cli']['command_line']; 60 | } 61 | 62 | if ($this->lastIdentifier !== $lastIdentifier) { 63 | $io->section($section); 64 | } 65 | 66 | if (isset($context['source'])) { 67 | $source = $context['source']; 68 | $sourceInfo = sprintf('%s on line %d', $source['name'], $source['line']); 69 | $fileLink = $source['file_link'] ?? null; 70 | if ($this->supportsHref && $fileLink) { 71 | $sourceInfo = sprintf('%s', $fileLink, $sourceInfo); 72 | } 73 | $rows[] = ['source', $sourceInfo]; 74 | $file = $source['file_relative'] ?? $source['file']; 75 | $rows[] = ['file', $file]; 76 | } 77 | 78 | $io->table([], $rows); 79 | 80 | if (!$this->supportsHref && isset($fileLink)) { 81 | $io->writeln(['Open source in your IDE/browser:', $fileLink]); 82 | $io->newLine(); 83 | } 84 | 85 | $this->dumper->dump($data); 86 | $io->newLine(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Command\Descriptor; 13 | 14 | use Symfony\Component\Console\Output\OutputInterface; 15 | use Symfony\Component\VarDumper\Cloner\Data; 16 | 17 | /** 18 | * @author Maxime Steinhausser 19 | */ 20 | interface DumpDescriptorInterface 21 | { 22 | public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Dumper\ContextProvider; 13 | 14 | /** 15 | * Tries to provide context on CLI. 16 | * 17 | * @author Maxime Steinhausser 18 | */ 19 | final class CliContextProvider implements ContextProviderInterface 20 | { 21 | public function getContext(): ?array 22 | { 23 | if ('cli' !== \PHP_SAPI) { 24 | return null; 25 | } 26 | 27 | return [ 28 | 'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []), 29 | 'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']), 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Dumper\ContextProvider; 13 | 14 | /** 15 | * Interface to provide contextual data about dump data clones sent to a server. 16 | * 17 | * @author Maxime Steinhausser 18 | */ 19 | interface ContextProviderInterface 20 | { 21 | /** 22 | * @return array|null Context data or null if unable to provide any context 23 | */ 24 | public function getContext(): ?array; 25 | } 26 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Dumper\ContextProvider; 13 | 14 | use Symfony\Component\HttpFoundation\RequestStack; 15 | use Symfony\Component\VarDumper\Caster\ReflectionCaster; 16 | use Symfony\Component\VarDumper\Cloner\VarCloner; 17 | 18 | /** 19 | * Tries to provide context from a request. 20 | * 21 | * @author Maxime Steinhausser 22 | */ 23 | final class RequestContextProvider implements ContextProviderInterface 24 | { 25 | private $requestStack; 26 | private $cloner; 27 | 28 | public function __construct(RequestStack $requestStack) 29 | { 30 | $this->requestStack = $requestStack; 31 | $this->cloner = new VarCloner(); 32 | $this->cloner->setMaxItems(0); 33 | $this->cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO); 34 | } 35 | 36 | public function getContext(): ?array 37 | { 38 | if (null === $request = $this->requestStack->getCurrentRequest()) { 39 | return null; 40 | } 41 | 42 | $controller = $request->attributes->get('_controller'); 43 | 44 | return [ 45 | 'uri' => $request->getUri(), 46 | 'method' => $request->getMethod(), 47 | 'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller, 48 | 'identifier' => spl_object_hash($request), 49 | ]; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; 16 | 17 | /** 18 | * @author Kévin Thérage 19 | */ 20 | class ContextualizedDumper implements DataDumperInterface 21 | { 22 | private $wrappedDumper; 23 | private $contextProviders; 24 | 25 | /** 26 | * @param ContextProviderInterface[] $contextProviders 27 | */ 28 | public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders) 29 | { 30 | $this->wrappedDumper = $wrappedDumper; 31 | $this->contextProviders = $contextProviders; 32 | } 33 | 34 | public function dump(Data $data) 35 | { 36 | $context = []; 37 | foreach ($this->contextProviders as $contextProvider) { 38 | $context[\get_class($contextProvider)] = $contextProvider->getContext(); 39 | } 40 | 41 | $this->wrappedDumper->dump($data->withContext($context)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/DataDumperInterface.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | 16 | /** 17 | * DataDumperInterface for dumping Data objects. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | interface DataDumperInterface 22 | { 23 | public function dump(Data $data); 24 | } 25 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/ServerDumper.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; 16 | use Symfony\Component\VarDumper\Server\Connection; 17 | 18 | /** 19 | * ServerDumper forwards serialized Data clones to a server. 20 | * 21 | * @author Maxime Steinhausser 22 | */ 23 | class ServerDumper implements DataDumperInterface 24 | { 25 | private $connection; 26 | private $wrappedDumper; 27 | 28 | /** 29 | * @param string $host The server host 30 | * @param DataDumperInterface|null $wrappedDumper A wrapped instance used whenever we failed contacting the server 31 | * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name 32 | */ 33 | public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = []) 34 | { 35 | $this->connection = new Connection($host, $contextProviders); 36 | $this->wrappedDumper = $wrappedDumper; 37 | } 38 | 39 | public function getContextProviders(): array 40 | { 41 | return $this->connection->getContextProviders(); 42 | } 43 | 44 | /** 45 | * {@inheritdoc} 46 | */ 47 | public function dump(Data $data) 48 | { 49 | if (!$this->connection->write($data) && $this->wrappedDumper) { 50 | $this->wrappedDumper->dump($data); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Exception/ThrowingCasterException.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Exception; 13 | 14 | /** 15 | * @author Nicolas Grekas 16 | */ 17 | class ThrowingCasterException extends \Exception 18 | { 19 | /** 20 | * @param \Throwable $prev The exception thrown from the caster 21 | */ 22 | public function __construct(\Throwable $prev) 23 | { 24 | parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2021 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/README.md: -------------------------------------------------------------------------------- 1 | VarDumper Component 2 | =================== 3 | 4 | The VarDumper component provides mechanisms for walking through any arbitrary 5 | PHP variable. It provides a better `dump()` function that you can use instead 6 | of `var_dump`. 7 | 8 | Resources 9 | --------- 10 | 11 | * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html) 12 | * [Contributing](https://symfony.com/doc/current/contributing/index.html) 13 | * [Report issues](https://github.com/symfony/symfony/issues) and 14 | [send Pull Requests](https://github.com/symfony/symfony/pulls) 15 | in the [main Symfony repository](https://github.com/symfony/symfony) 16 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/bin/var-dump-server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | 8 | * 9 | * For the full copyright and license information, please view the LICENSE 10 | * file that was distributed with this source code. 11 | */ 12 | 13 | /** 14 | * Starts a dump server to collect and output dumps on a single place with multiple formats support. 15 | * 16 | * @author Maxime Steinhausser 17 | */ 18 | 19 | use Psr\Log\LoggerInterface; 20 | use Symfony\Component\Console\Application; 21 | use Symfony\Component\Console\Input\ArgvInput; 22 | use Symfony\Component\Console\Input\InputOption; 23 | use Symfony\Component\Console\Logger\ConsoleLogger; 24 | use Symfony\Component\Console\Output\ConsoleOutput; 25 | use Symfony\Component\VarDumper\Command\ServerDumpCommand; 26 | use Symfony\Component\VarDumper\Server\DumpServer; 27 | 28 | function includeIfExists(string $file): bool 29 | { 30 | return file_exists($file) && include $file; 31 | } 32 | 33 | if ( 34 | !includeIfExists(__DIR__ . '/../../../../autoload.php') && 35 | !includeIfExists(__DIR__ . '/../../vendor/autoload.php') && 36 | !includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php') 37 | ) { 38 | fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL); 39 | exit(1); 40 | } 41 | 42 | if (!class_exists(Application::class)) { 43 | fwrite(STDERR, 'You need the "symfony/console" component in order to run the VarDumper server.'.PHP_EOL); 44 | exit(1); 45 | } 46 | 47 | $input = new ArgvInput(); 48 | $output = new ConsoleOutput(); 49 | $defaultHost = '127.0.0.1:9912'; 50 | $host = $input->getParameterOption(['--host'], $_SERVER['VAR_DUMPER_SERVER'] ?? $defaultHost, true); 51 | $logger = interface_exists(LoggerInterface::class) ? new ConsoleLogger($output->getErrorOutput()) : null; 52 | 53 | $app = new Application(); 54 | 55 | $app->getDefinition()->addOption( 56 | new InputOption('--host', null, InputOption::VALUE_REQUIRED, 'The address the server should listen to', $defaultHost) 57 | ); 58 | 59 | $app->add($command = new ServerDumpCommand(new DumpServer($host, $logger))) 60 | ->getApplication() 61 | ->setDefaultCommand($command->getName(), true) 62 | ->run($input, $output) 63 | ; 64 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css: -------------------------------------------------------------------------------- 1 | body { 2 | display: flex; 3 | flex-direction: column-reverse; 4 | justify-content: flex-end; 5 | max-width: 1140px; 6 | margin: auto; 7 | padding: 15px; 8 | word-wrap: break-word; 9 | background-color: #F9F9F9; 10 | color: #222; 11 | font-family: Helvetica, Arial, sans-serif; 12 | font-size: 14px; 13 | line-height: 1.4; 14 | } 15 | p { 16 | margin: 0; 17 | } 18 | a { 19 | color: #218BC3; 20 | text-decoration: none; 21 | } 22 | a:hover { 23 | text-decoration: underline; 24 | } 25 | .text-small { 26 | font-size: 12px !important; 27 | } 28 | article { 29 | margin: 5px; 30 | margin-bottom: 10px; 31 | } 32 | article > header > .row { 33 | display: flex; 34 | flex-direction: row; 35 | align-items: baseline; 36 | margin-bottom: 10px; 37 | } 38 | article > header > .row > .col { 39 | flex: 1; 40 | display: flex; 41 | align-items: baseline; 42 | } 43 | article > header > .row > h2 { 44 | font-size: 14px; 45 | color: #222; 46 | font-weight: normal; 47 | font-family: "Lucida Console", monospace, sans-serif; 48 | word-break: break-all; 49 | margin: 20px 5px 0 0; 50 | user-select: all; 51 | } 52 | article > header > .row > h2 > code { 53 | white-space: nowrap; 54 | user-select: none; 55 | color: #cc2255; 56 | background-color: #f7f7f9; 57 | border: 1px solid #e1e1e8; 58 | border-radius: 3px; 59 | margin-right: 5px; 60 | padding: 0 3px; 61 | } 62 | article > header > .row > time.col { 63 | flex: 0; 64 | text-align: right; 65 | white-space: nowrap; 66 | color: #999; 67 | font-style: italic; 68 | } 69 | article > header ul.tags { 70 | list-style: none; 71 | padding: 0; 72 | margin: 0; 73 | font-size: 12px; 74 | } 75 | article > header ul.tags > li { 76 | user-select: all; 77 | margin-bottom: 2px; 78 | } 79 | article > header ul.tags > li > span.badge { 80 | display: inline-block; 81 | padding: .25em .4em; 82 | margin-right: 5px; 83 | border-radius: 4px; 84 | background-color: #6c757d3b; 85 | color: #524d4d; 86 | font-size: 12px; 87 | text-align: center; 88 | font-weight: 700; 89 | line-height: 1; 90 | white-space: nowrap; 91 | vertical-align: baseline; 92 | user-select: none; 93 | } 94 | article > section.body { 95 | border: 1px solid #d8d8d8; 96 | background: #FFF; 97 | padding: 10px; 98 | border-radius: 3px; 99 | } 100 | pre.sf-dump { 101 | border-radius: 3px; 102 | margin-bottom: 0; 103 | } 104 | .hidden { 105 | display: none !important; 106 | } 107 | .dumped-tag > .sf-dump { 108 | display: inline-block; 109 | margin: 0; 110 | padding: 1px 5px; 111 | line-height: 1.4; 112 | vertical-align: top; 113 | background-color: transparent; 114 | user-select: auto; 115 | } 116 | .dumped-tag > pre.sf-dump, 117 | .dumped-tag > .sf-dump-default { 118 | color: #CC7832; 119 | background: none; 120 | } 121 | .dumped-tag > .sf-dump .sf-dump-str { color: #629755; } 122 | .dumped-tag > .sf-dump .sf-dump-private, 123 | .dumped-tag > .sf-dump .sf-dump-protected, 124 | .dumped-tag > .sf-dump .sf-dump-public { color: #262626; } 125 | .dumped-tag > .sf-dump .sf-dump-note { color: #6897BB; } 126 | .dumped-tag > .sf-dump .sf-dump-key { color: #789339; } 127 | .dumped-tag > .sf-dump .sf-dump-ref { color: #6E6E6E; } 128 | .dumped-tag > .sf-dump .sf-dump-ellipsis { color: #CC7832; max-width: 100em; } 129 | .dumped-tag > .sf-dump .sf-dump-ellipsis-path { max-width: 5em; } 130 | .dumped-tag > .sf-dump .sf-dump-ns { user-select: none; } 131 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/functions/dump.php: -------------------------------------------------------------------------------- 1 | 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 | use Symfony\Component\VarDumper\VarDumper; 13 | 14 | if (!function_exists('dump')) { 15 | /** 16 | * @author Nicolas Grekas 17 | */ 18 | function dump($var, ...$moreVars) 19 | { 20 | VarDumper::dump($var); 21 | 22 | foreach ($moreVars as $v) { 23 | VarDumper::dump($v); 24 | } 25 | 26 | if (1 < func_num_args()) { 27 | return func_get_args(); 28 | } 29 | 30 | return $var; 31 | } 32 | } 33 | 34 | if (!function_exists('dd')) { 35 | function dd(...$vars) 36 | { 37 | foreach ($vars as $v) { 38 | VarDumper::dump($v); 39 | } 40 | 41 | exit(1); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | let prev = null; 3 | Array.from(document.getElementsByTagName('article')).reverse().forEach(function (article) { 4 | const dedupId = article.dataset.dedupId; 5 | if (dedupId === prev) { 6 | article.getElementsByTagName('header')[0].classList.add('hidden'); 7 | } 8 | prev = dedupId; 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Server/Connection.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Server; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; 16 | 17 | /** 18 | * Forwards serialized Data clones to a server. 19 | * 20 | * @author Maxime Steinhausser 21 | */ 22 | class Connection 23 | { 24 | private $host; 25 | private $contextProviders; 26 | private $socket; 27 | 28 | /** 29 | * @param string $host The server host 30 | * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name 31 | */ 32 | public function __construct(string $host, array $contextProviders = []) 33 | { 34 | if (!str_contains($host, '://')) { 35 | $host = 'tcp://'.$host; 36 | } 37 | 38 | $this->host = $host; 39 | $this->contextProviders = $contextProviders; 40 | } 41 | 42 | public function getContextProviders(): array 43 | { 44 | return $this->contextProviders; 45 | } 46 | 47 | public function write(Data $data): bool 48 | { 49 | $socketIsFresh = !$this->socket; 50 | if (!$this->socket = $this->socket ?: $this->createSocket()) { 51 | return false; 52 | } 53 | 54 | $context = ['timestamp' => microtime(true)]; 55 | foreach ($this->contextProviders as $name => $provider) { 56 | $context[$name] = $provider->getContext(); 57 | } 58 | $context = array_filter($context); 59 | $encodedPayload = base64_encode(serialize([$data, $context]))."\n"; 60 | 61 | set_error_handler([self::class, 'nullErrorHandler']); 62 | try { 63 | if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { 64 | return true; 65 | } 66 | if (!$socketIsFresh) { 67 | stream_socket_shutdown($this->socket, \STREAM_SHUT_RDWR); 68 | fclose($this->socket); 69 | $this->socket = $this->createSocket(); 70 | } 71 | if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) { 72 | return true; 73 | } 74 | } finally { 75 | restore_error_handler(); 76 | } 77 | 78 | return false; 79 | } 80 | 81 | private static function nullErrorHandler(int $t, string $m) 82 | { 83 | // no-op 84 | } 85 | 86 | private function createSocket() 87 | { 88 | set_error_handler([self::class, 'nullErrorHandler']); 89 | try { 90 | return stream_socket_client($this->host, $errno, $errstr, 3, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT); 91 | } finally { 92 | restore_error_handler(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Server/DumpServer.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Server; 13 | 14 | use Psr\Log\LoggerInterface; 15 | use Symfony\Component\VarDumper\Cloner\Data; 16 | use Symfony\Component\VarDumper\Cloner\Stub; 17 | 18 | /** 19 | * A server collecting Data clones sent by a ServerDumper. 20 | * 21 | * @author Maxime Steinhausser 22 | * 23 | * @final 24 | */ 25 | class DumpServer 26 | { 27 | private $host; 28 | private $socket; 29 | private $logger; 30 | 31 | public function __construct(string $host, LoggerInterface $logger = null) 32 | { 33 | if (!str_contains($host, '://')) { 34 | $host = 'tcp://'.$host; 35 | } 36 | 37 | $this->host = $host; 38 | $this->logger = $logger; 39 | } 40 | 41 | public function start(): void 42 | { 43 | if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) { 44 | throw new \RuntimeException(sprintf('Server start failed on "%s": ', $this->host).$errstr.' '.$errno); 45 | } 46 | } 47 | 48 | public function listen(callable $callback): void 49 | { 50 | if (null === $this->socket) { 51 | $this->start(); 52 | } 53 | 54 | foreach ($this->getMessages() as $clientId => $message) { 55 | if ($this->logger) { 56 | $this->logger->info('Received a payload from client {clientId}', ['clientId' => $clientId]); 57 | } 58 | 59 | $payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]); 60 | 61 | // Impossible to decode the message, give up. 62 | if (false === $payload) { 63 | if ($this->logger) { 64 | $this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]); 65 | } 66 | 67 | continue; 68 | } 69 | 70 | if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) { 71 | if ($this->logger) { 72 | $this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]); 73 | } 74 | 75 | continue; 76 | } 77 | 78 | [$data, $context] = $payload; 79 | 80 | $callback($data, $context, $clientId); 81 | } 82 | } 83 | 84 | public function getHost(): string 85 | { 86 | return $this->host; 87 | } 88 | 89 | private function getMessages(): iterable 90 | { 91 | $sockets = [(int) $this->socket => $this->socket]; 92 | $write = []; 93 | 94 | while (true) { 95 | $read = $sockets; 96 | stream_select($read, $write, $write, null); 97 | 98 | foreach ($read as $stream) { 99 | if ($this->socket === $stream) { 100 | $stream = stream_socket_accept($this->socket); 101 | $sockets[(int) $stream] = $stream; 102 | } elseif (feof($stream)) { 103 | unset($sockets[(int) $stream]); 104 | fclose($stream); 105 | } else { 106 | yield (int) $stream => fgets($stream); 107 | } 108 | } 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Test/VarDumperTestTrait.php: -------------------------------------------------------------------------------- 1 | 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 Symfony\Component\VarDumper\Test; 13 | 14 | use Symfony\Component\VarDumper\Cloner\VarCloner; 15 | use Symfony\Component\VarDumper\Dumper\CliDumper; 16 | 17 | /** 18 | * @author Nicolas Grekas 19 | */ 20 | trait VarDumperTestTrait 21 | { 22 | /** 23 | * @internal 24 | */ 25 | private $varDumperConfig = [ 26 | 'casters' => [], 27 | 'flags' => null, 28 | ]; 29 | 30 | protected function setUpVarDumper(array $casters, int $flags = null): void 31 | { 32 | $this->varDumperConfig['casters'] = $casters; 33 | $this->varDumperConfig['flags'] = $flags; 34 | } 35 | 36 | /** 37 | * @after 38 | */ 39 | protected function tearDownVarDumper(): void 40 | { 41 | $this->varDumperConfig['casters'] = []; 42 | $this->varDumperConfig['flags'] = null; 43 | } 44 | 45 | public function assertDumpEquals($expected, $data, int $filter = 0, string $message = '') 46 | { 47 | $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); 48 | } 49 | 50 | public function assertDumpMatchesFormat($expected, $data, int $filter = 0, string $message = '') 51 | { 52 | $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); 53 | } 54 | 55 | protected function getDump($data, $key = null, int $filter = 0): ?string 56 | { 57 | if (null === $flags = $this->varDumperConfig['flags']) { 58 | $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; 59 | $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; 60 | $flags |= getenv('DUMP_COMMA_SEPARATOR') ? CliDumper::DUMP_COMMA_SEPARATOR : 0; 61 | } 62 | 63 | $cloner = new VarCloner(); 64 | $cloner->addCasters($this->varDumperConfig['casters']); 65 | $cloner->setMaxItems(-1); 66 | $dumper = new CliDumper(null, null, $flags); 67 | $dumper->setColors(false); 68 | $data = $cloner->cloneVar($data, $filter)->withRefHandles(false); 69 | if (null !== $key && null === $data = $data->seek($key)) { 70 | return null; 71 | } 72 | 73 | return rtrim($dumper->dump($data, true)); 74 | } 75 | 76 | private function prepareExpectation($expected, int $filter): string 77 | { 78 | if (!\is_string($expected)) { 79 | $expected = $this->getDump($expected, null, $filter); 80 | } 81 | 82 | return rtrim($expected); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/var-dumper", 3 | "type": "library", 4 | "description": "Provides mechanisms for walking through any arbitrary PHP variable", 5 | "keywords": ["dump", "debug"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.2.5", 20 | "symfony/polyfill-mbstring": "~1.0", 21 | "symfony/polyfill-php80": "^1.16" 22 | }, 23 | "require-dev": { 24 | "ext-iconv": "*", 25 | "symfony/console": "^4.4|^5.0", 26 | "symfony/process": "^4.4|^5.0", 27 | "twig/twig": "^2.13|^3.0.4" 28 | }, 29 | "conflict": { 30 | "phpunit/phpunit": "<5.4.3", 31 | "symfony/console": "<4.4" 32 | }, 33 | "suggest": { 34 | "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", 35 | "ext-intl": "To show region name in time zone dump", 36 | "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" 37 | }, 38 | "autoload": { 39 | "files": [ "Resources/functions/dump.php" ], 40 | "psr-4": { "Symfony\\Component\\VarDumper\\": "" }, 41 | "exclude-from-classmap": [ 42 | "/Tests/" 43 | ] 44 | }, 45 | "bin": [ 46 | "Resources/bin/var-dump-server" 47 | ], 48 | "minimum-stability": "dev" 49 | } 50 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2014, Graham Campbell. 4 | Copyright (c) 2013, Vance Lucas. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | 3. Neither the name of the copyright holder nor the names of its 18 | contributors may be used to endorse or promote products derived from 19 | this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 28 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vlucas/phpdotenv", 3 | "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", 4 | "keywords": ["env", "dotenv", "environment"], 5 | "license": "BSD-3-Clause", 6 | "authors": [ 7 | { 8 | "name": "Graham Campbell", 9 | "email": "hello@gjcampbell.co.uk" 10 | }, 11 | { 12 | "name": "Vance Lucas", 13 | "email": "vance@vancelucas.com" 14 | } 15 | ], 16 | "require": { 17 | "php": "^7.1.3 || ^8.0", 18 | "ext-pcre": "*", 19 | "graham-campbell/result-type": "^1.0.2", 20 | "phpoption/phpoption": "^1.8", 21 | "symfony/polyfill-ctype": "^1.23", 22 | "symfony/polyfill-mbstring": "^1.23.1", 23 | "symfony/polyfill-php80": "^1.23.1" 24 | }, 25 | "require-dev": { 26 | "ext-filter": "*", 27 | "bamarni/composer-bin-plugin": "^1.4.1", 28 | "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "Dotenv\\": "src/" 33 | } 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { 37 | "Dotenv\\Tests\\": "tests/Dotenv/" 38 | } 39 | }, 40 | "suggest": { 41 | "ext-filter": "Required to use the boolean validator." 42 | }, 43 | "config": { 44 | "preferred-install": "dist" 45 | }, 46 | "extra": { 47 | "branch-alias": { 48 | "dev-master": "5.3-dev" 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | public function load(RepositoryInterface $repository, array $entries) 25 | { 26 | return \array_reduce($entries, static function (array $vars, Entry $entry) use ($repository) { 27 | $name = $entry->getName(); 28 | 29 | $value = $entry->getValue()->map(static function (Value $value) use ($repository) { 30 | return Resolver::resolve($repository, $value); 31 | }); 32 | 33 | if ($value->isDefined()) { 34 | $inner = $value->get(); 35 | if ($repository->set($name, $inner)) { 36 | return \array_merge($vars, [$name => $inner]); 37 | } 38 | } else { 39 | if ($repository->clear($name)) { 40 | return \array_merge($vars, [$name => null]); 41 | } 42 | } 43 | 44 | return $vars; 45 | }, []); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | public function load(RepositoryInterface $repository, array $entries); 20 | } 21 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Loader/Resolver.php: -------------------------------------------------------------------------------- 1 | getVars(), static function (string $s, int $i) use ($repository) { 41 | return Str::substr($s, 0, $i).self::resolveVariable($repository, Str::substr($s, $i)); 42 | }, $value->getChars()); 43 | } 44 | 45 | /** 46 | * Resolve a single nested variable. 47 | * 48 | * @param \Dotenv\Repository\RepositoryInterface $repository 49 | * @param string $str 50 | * 51 | * @return string 52 | */ 53 | private static function resolveVariable(RepositoryInterface $repository, string $str) 54 | { 55 | return Regex::replaceCallback( 56 | '/\A\${([a-zA-Z0-9_.]+)}/', 57 | static function (array $matches) use ($repository) { 58 | return Option::fromValue($repository->get($matches[1])) 59 | ->getOrElse($matches[0]); 60 | }, 61 | $str, 62 | 1 63 | )->success()->getOrElse($str); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/Entry.php: -------------------------------------------------------------------------------- 1 | name = $name; 36 | $this->value = $value; 37 | } 38 | 39 | /** 40 | * Get the entry name. 41 | * 42 | * @return string 43 | */ 44 | public function getName() 45 | { 46 | return $this->name; 47 | } 48 | 49 | /** 50 | * Get the entry value. 51 | * 52 | * @return \PhpOption\Option<\Dotenv\Parser\Value> 53 | */ 54 | public function getValue() 55 | { 56 | /** @var \PhpOption\Option<\Dotenv\Parser\Value> */ 57 | return Option::fromValue($this->value); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/Lexer.php: -------------------------------------------------------------------------------- 1 | 39 | */ 40 | public static function lex(string $content) 41 | { 42 | static $regex; 43 | 44 | if ($regex === null) { 45 | $regex = '(('.\implode(')|(', self::PATTERNS).'))A'; 46 | } 47 | 48 | $tokens = []; 49 | 50 | $offset = 0; 51 | 52 | while (isset($content[$offset])) { 53 | if (!\preg_match($regex, $content, $matches, 0, $offset)) { 54 | throw new \Error(\sprintf('Lexer encountered unexpected character [%s].', $content[$offset])); 55 | } 56 | 57 | $offset += \strlen($matches[0]); 58 | 59 | yield $matches[0]; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/Lines.php: -------------------------------------------------------------------------------- 1 | map(static function () use ($line) { 89 | return self::looksLikeMultilineStop($line, true) === false; 90 | })->getOrElse(false); 91 | } 92 | 93 | /** 94 | * Determine if the given line can be the start of a multiline variable. 95 | * 96 | * @param string $line 97 | * @param bool $started 98 | * 99 | * @return bool 100 | */ 101 | private static function looksLikeMultilineStop(string $line, bool $started) 102 | { 103 | if ($line === '"') { 104 | return true; 105 | } 106 | 107 | return Regex::occurences('/(?=([^\\\\]"))/', \str_replace('\\\\', '', $line))->map(static function (int $count) use ($started) { 108 | return $started ? $count > 1 : $count >= 1; 109 | })->success()->getOrElse(false); 110 | } 111 | 112 | /** 113 | * Determine if the line in the file is a comment or whitespace. 114 | * 115 | * @param string $line 116 | * 117 | * @return bool 118 | */ 119 | private static function isCommentOrWhitespace(string $line) 120 | { 121 | $line = \trim($line); 122 | 123 | return $line === '' || (isset($line[0]) && $line[0] === '#'); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/Parser.php: -------------------------------------------------------------------------------- 1 | mapError(static function () { 26 | return 'Could not split into separate lines.'; 27 | })->flatMap(static function (array $lines) { 28 | return self::process(Lines::process($lines)); 29 | })->mapError(static function (string $error) { 30 | throw new InvalidFileException(\sprintf('Failed to parse dotenv file. %s', $error)); 31 | })->success()->get(); 32 | } 33 | 34 | /** 35 | * Convert the raw entries into proper entries. 36 | * 37 | * @param string[] $entries 38 | * 39 | * @return \GrahamCampbell\ResultType\Result<\Dotenv\Parser\Entry[],string> 40 | */ 41 | private static function process(array $entries) 42 | { 43 | /** @var \GrahamCampbell\ResultType\Result<\Dotenv\Parser\Entry[],string> */ 44 | return \array_reduce($entries, static function (Result $result, string $raw) { 45 | return $result->flatMap(static function (array $entries) use ($raw) { 46 | return EntryParser::parse($raw)->map(static function (Entry $entry) use ($entries) { 47 | return \array_merge($entries, [$entry]); 48 | }); 49 | }); 50 | }, Success::create([])); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php: -------------------------------------------------------------------------------- 1 | chars = $chars; 36 | $this->vars = $vars; 37 | } 38 | 39 | /** 40 | * Create an empty value instance. 41 | * 42 | * @return \Dotenv\Parser\Value 43 | */ 44 | public static function blank() 45 | { 46 | return new self('', []); 47 | } 48 | 49 | /** 50 | * Create a new value instance, appending the characters. 51 | * 52 | * @param string $chars 53 | * @param bool $var 54 | * 55 | * @return \Dotenv\Parser\Value 56 | */ 57 | public function append(string $chars, bool $var) 58 | { 59 | return new self( 60 | $this->chars.$chars, 61 | $var ? \array_merge($this->vars, [Str::len($this->chars)]) : $this->vars 62 | ); 63 | } 64 | 65 | /** 66 | * Get the string representation of the parsed value. 67 | * 68 | * @return string 69 | */ 70 | public function getChars() 71 | { 72 | return $this->chars; 73 | } 74 | 75 | /** 76 | * Get the locations of the variables in the value. 77 | * 78 | * @return int[] 79 | */ 80 | public function getVars() 81 | { 82 | $vars = $this->vars; 83 | 84 | \rsort($vars); 85 | 86 | return $vars; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public static function create(); 15 | } 16 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | public static function create() 29 | { 30 | if (self::isSupported()) { 31 | /** @var \PhpOption\Option */ 32 | return Some::create(new self()); 33 | } 34 | 35 | return None::create(); 36 | } 37 | 38 | /** 39 | * Determines if the adapter is supported. 40 | * 41 | * This happens if PHP is running as an Apache module. 42 | * 43 | * @return bool 44 | */ 45 | private static function isSupported() 46 | { 47 | return \function_exists('apache_getenv') && \function_exists('apache_setenv'); 48 | } 49 | 50 | /** 51 | * Read an environment variable, if it exists. 52 | * 53 | * @param string $name 54 | * 55 | * @return \PhpOption\Option 56 | */ 57 | public function read(string $name) 58 | { 59 | /** @var \PhpOption\Option */ 60 | return Option::fromValue(apache_getenv($name))->filter(static function ($value) { 61 | return \is_string($value) && $value !== ''; 62 | }); 63 | } 64 | 65 | /** 66 | * Write to an environment variable, if possible. 67 | * 68 | * @param string $name 69 | * @param string $value 70 | * 71 | * @return bool 72 | */ 73 | public function write(string $name, string $value) 74 | { 75 | return apache_setenv($name, $value); 76 | } 77 | 78 | /** 79 | * Delete an environment variable, if possible. 80 | * 81 | * @param string $name 82 | * 83 | * @return bool 84 | */ 85 | public function delete(string $name) 86 | { 87 | return apache_setenv($name, ''); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | private $variables; 18 | 19 | /** 20 | * Create a new array adapter instance. 21 | * 22 | * @return void 23 | */ 24 | private function __construct() 25 | { 26 | $this->variables = []; 27 | } 28 | 29 | /** 30 | * Create a new instance of the adapter, if it is available. 31 | * 32 | * @return \PhpOption\Option<\Dotenv\Repository\Adapter\AdapterInterface> 33 | */ 34 | public static function create() 35 | { 36 | /** @var \PhpOption\Option */ 37 | return Some::create(new self()); 38 | } 39 | 40 | /** 41 | * Read an environment variable, if it exists. 42 | * 43 | * @param string $name 44 | * 45 | * @return \PhpOption\Option 46 | */ 47 | public function read(string $name) 48 | { 49 | return Option::fromArraysValue($this->variables, $name); 50 | } 51 | 52 | /** 53 | * Write to an environment variable, if possible. 54 | * 55 | * @param string $name 56 | * @param string $value 57 | * 58 | * @return bool 59 | */ 60 | public function write(string $name, string $value) 61 | { 62 | $this->variables[$name] = $value; 63 | 64 | return true; 65 | } 66 | 67 | /** 68 | * Delete an environment variable, if possible. 69 | * 70 | * @param string $name 71 | * 72 | * @return bool 73 | */ 74 | public function delete(string $name) 75 | { 76 | unset($this->variables[$name]); 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php: -------------------------------------------------------------------------------- 1 | 26 | */ 27 | public static function create() 28 | { 29 | /** @var \PhpOption\Option */ 30 | return Some::create(new self()); 31 | } 32 | 33 | /** 34 | * Read an environment variable, if it exists. 35 | * 36 | * @param string $name 37 | * 38 | * @return \PhpOption\Option 39 | */ 40 | public function read(string $name) 41 | { 42 | /** @var \PhpOption\Option */ 43 | return Option::fromArraysValue($_ENV, $name) 44 | ->map(static function ($value) { 45 | if ($value === false) { 46 | return 'false'; 47 | } 48 | 49 | if ($value === true) { 50 | return 'true'; 51 | } 52 | 53 | return $value; 54 | })->filter(static function ($value) { 55 | return \is_string($value); 56 | }); 57 | } 58 | 59 | /** 60 | * Write to an environment variable, if possible. 61 | * 62 | * @param string $name 63 | * @param string $value 64 | * 65 | * @return bool 66 | */ 67 | public function write(string $name, string $value) 68 | { 69 | $_ENV[$name] = $value; 70 | 71 | return true; 72 | } 73 | 74 | /** 75 | * Delete an environment variable, if possible. 76 | * 77 | * @param string $name 78 | * 79 | * @return bool 80 | */ 81 | public function delete(string $name) 82 | { 83 | unset($_ENV[$name]); 84 | 85 | return true; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php: -------------------------------------------------------------------------------- 1 | writer = $writer; 34 | $this->allowList = $allowList; 35 | } 36 | 37 | /** 38 | * Write to an environment variable, if possible. 39 | * 40 | * @param string $name 41 | * @param string $value 42 | * 43 | * @return bool 44 | */ 45 | public function write(string $name, string $value) 46 | { 47 | // Don't set non-allowed variables 48 | if (!$this->isAllowed($name)) { 49 | return false; 50 | } 51 | 52 | // Set the value on the inner writer 53 | return $this->writer->write($name, $value); 54 | } 55 | 56 | /** 57 | * Delete an environment variable, if possible. 58 | * 59 | * @param string $name 60 | * 61 | * @return bool 62 | */ 63 | public function delete(string $name) 64 | { 65 | // Don't clear non-allowed variables 66 | if (!$this->isAllowed($name)) { 67 | return false; 68 | } 69 | 70 | // Set the value on the inner writer 71 | return $this->writer->delete($name); 72 | } 73 | 74 | /** 75 | * Determine if the given variable is allowed. 76 | * 77 | * @param string $name 78 | * 79 | * @return bool 80 | */ 81 | private function isAllowed(string $name) 82 | { 83 | return \in_array($name, $this->allowList, true); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | private $loaded; 29 | 30 | /** 31 | * Create a new immutable writer instance. 32 | * 33 | * @param \Dotenv\Repository\Adapter\WriterInterface $writer 34 | * @param \Dotenv\Repository\Adapter\ReaderInterface $reader 35 | * 36 | * @return void 37 | */ 38 | public function __construct(WriterInterface $writer, ReaderInterface $reader) 39 | { 40 | $this->writer = $writer; 41 | $this->reader = $reader; 42 | $this->loaded = []; 43 | } 44 | 45 | /** 46 | * Write to an environment variable, if possible. 47 | * 48 | * @param string $name 49 | * @param string $value 50 | * 51 | * @return bool 52 | */ 53 | public function write(string $name, string $value) 54 | { 55 | // Don't overwrite existing environment variables 56 | // Ruby's dotenv does this with `ENV[key] ||= value` 57 | if ($this->isExternallyDefined($name)) { 58 | return false; 59 | } 60 | 61 | // Set the value on the inner writer 62 | if (!$this->writer->write($name, $value)) { 63 | return false; 64 | } 65 | 66 | // Record that we have loaded the variable 67 | $this->loaded[$name] = ''; 68 | 69 | return true; 70 | } 71 | 72 | /** 73 | * Delete an environment variable, if possible. 74 | * 75 | * @param string $name 76 | * 77 | * @return bool 78 | */ 79 | public function delete(string $name) 80 | { 81 | // Don't clear existing environment variables 82 | if ($this->isExternallyDefined($name)) { 83 | return false; 84 | } 85 | 86 | // Clear the value on the inner writer 87 | if (!$this->writer->delete($name)) { 88 | return false; 89 | } 90 | 91 | // Leave the variable as fair game 92 | unset($this->loaded[$name]); 93 | 94 | return true; 95 | } 96 | 97 | /** 98 | * Determine if the given variable is externally defined. 99 | * 100 | * That is, is it an "existing" variable. 101 | * 102 | * @param string $name 103 | * 104 | * @return bool 105 | */ 106 | private function isExternallyDefined(string $name) 107 | { 108 | return $this->reader->read($name)->isDefined() && !isset($this->loaded[$name]); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php: -------------------------------------------------------------------------------- 1 | readers = $readers; 28 | } 29 | 30 | /** 31 | * Read an environment variable, if it exists. 32 | * 33 | * @param string $name 34 | * 35 | * @return \PhpOption\Option 36 | */ 37 | public function read(string $name) 38 | { 39 | foreach ($this->readers as $reader) { 40 | $result = $reader->read($name); 41 | if ($result->isDefined()) { 42 | return $result; 43 | } 44 | } 45 | 46 | return None::create(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php: -------------------------------------------------------------------------------- 1 | writers = $writers; 26 | } 27 | 28 | /** 29 | * Write to an environment variable, if possible. 30 | * 31 | * @param string $name 32 | * @param string $value 33 | * 34 | * @return bool 35 | */ 36 | public function write(string $name, string $value) 37 | { 38 | foreach ($this->writers as $writers) { 39 | if (!$writers->write($name, $value)) { 40 | return false; 41 | } 42 | } 43 | 44 | return true; 45 | } 46 | 47 | /** 48 | * Delete an environment variable, if possible. 49 | * 50 | * @param string $name 51 | * 52 | * @return bool 53 | */ 54 | public function delete(string $name) 55 | { 56 | foreach ($this->writers as $writers) { 57 | if (!$writers->delete($name)) { 58 | return false; 59 | } 60 | } 61 | 62 | return true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | public static function create() 29 | { 30 | if (self::isSupported()) { 31 | /** @var \PhpOption\Option */ 32 | return Some::create(new self()); 33 | } 34 | 35 | return None::create(); 36 | } 37 | 38 | /** 39 | * Determines if the adapter is supported. 40 | * 41 | * @return bool 42 | */ 43 | private static function isSupported() 44 | { 45 | return \function_exists('getenv') && \function_exists('putenv'); 46 | } 47 | 48 | /** 49 | * Read an environment variable, if it exists. 50 | * 51 | * @param string $name 52 | * 53 | * @return \PhpOption\Option 54 | */ 55 | public function read(string $name) 56 | { 57 | /** @var \PhpOption\Option */ 58 | return Option::fromValue(\getenv($name), false)->filter(static function ($value) { 59 | return \is_string($value); 60 | }); 61 | } 62 | 63 | /** 64 | * Write to an environment variable, if possible. 65 | * 66 | * @param string $name 67 | * @param string $value 68 | * 69 | * @return bool 70 | */ 71 | public function write(string $name, string $value) 72 | { 73 | \putenv("$name=$value"); 74 | 75 | return true; 76 | } 77 | 78 | /** 79 | * Delete an environment variable, if possible. 80 | * 81 | * @param string $name 82 | * 83 | * @return bool 84 | */ 85 | public function delete(string $name) 86 | { 87 | \putenv($name); 88 | 89 | return true; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | public function read(string $name); 17 | } 18 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | private $seen; 29 | 30 | /** 31 | * Create a new replacement writer instance. 32 | * 33 | * @param \Dotenv\Repository\Adapter\WriterInterface $writer 34 | * @param \Dotenv\Repository\Adapter\ReaderInterface $reader 35 | * 36 | * @return void 37 | */ 38 | public function __construct(WriterInterface $writer, ReaderInterface $reader) 39 | { 40 | $this->writer = $writer; 41 | $this->reader = $reader; 42 | $this->seen = []; 43 | } 44 | 45 | /** 46 | * Write to an environment variable, if possible. 47 | * 48 | * @param string $name 49 | * @param string $value 50 | * 51 | * @return bool 52 | */ 53 | public function write(string $name, string $value) 54 | { 55 | if ($this->exists($name)) { 56 | return $this->writer->write($name, $value); 57 | } 58 | 59 | // succeed if nothing to do 60 | return true; 61 | } 62 | 63 | /** 64 | * Delete an environment variable, if possible. 65 | * 66 | * @param string $name 67 | * 68 | * @return bool 69 | */ 70 | public function delete(string $name) 71 | { 72 | if ($this->exists($name)) { 73 | return $this->writer->delete($name); 74 | } 75 | 76 | // succeed if nothing to do 77 | return true; 78 | } 79 | 80 | /** 81 | * Does the given environment variable exist. 82 | * 83 | * Returns true if it currently exists, or existed at any point in the past 84 | * that we are aware of. 85 | * 86 | * @param string $name 87 | * 88 | * @return bool 89 | */ 90 | private function exists(string $name) 91 | { 92 | if (isset($this->seen[$name])) { 93 | return true; 94 | } 95 | 96 | if ($this->reader->read($name)->isDefined()) { 97 | $this->seen[$name] = ''; 98 | 99 | return true; 100 | } 101 | 102 | return false; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php: -------------------------------------------------------------------------------- 1 | 26 | */ 27 | public static function create() 28 | { 29 | /** @var \PhpOption\Option */ 30 | return Some::create(new self()); 31 | } 32 | 33 | /** 34 | * Read an environment variable, if it exists. 35 | * 36 | * @param string $name 37 | * 38 | * @return \PhpOption\Option 39 | */ 40 | public function read(string $name) 41 | { 42 | /** @var \PhpOption\Option */ 43 | return Option::fromArraysValue($_SERVER, $name) 44 | ->map(static function ($value) { 45 | if ($value === false) { 46 | return 'false'; 47 | } 48 | 49 | if ($value === true) { 50 | return 'true'; 51 | } 52 | 53 | return $value; 54 | })->filter(static function ($value) { 55 | return \is_string($value); 56 | }); 57 | } 58 | 59 | /** 60 | * Write to an environment variable, if possible. 61 | * 62 | * @param string $name 63 | * @param string $value 64 | * 65 | * @return bool 66 | */ 67 | public function write(string $name, string $value) 68 | { 69 | $_SERVER[$name] = $value; 70 | 71 | return true; 72 | } 73 | 74 | /** 75 | * Delete an environment variable, if possible. 76 | * 77 | * @param string $name 78 | * 79 | * @return bool 80 | */ 81 | public function delete(string $name) 82 | { 83 | unset($_SERVER[$name]); 84 | 85 | return true; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php: -------------------------------------------------------------------------------- 1 | reader = $reader; 37 | $this->writer = $writer; 38 | } 39 | 40 | /** 41 | * Determine if the given environment variable is defined. 42 | * 43 | * @param string $name 44 | * 45 | * @return bool 46 | */ 47 | public function has(string $name) 48 | { 49 | return $this->reader->read($name)->isDefined(); 50 | } 51 | 52 | /** 53 | * Get an environment variable. 54 | * 55 | * @param string $name 56 | * 57 | * @return string|null 58 | */ 59 | public function get(string $name) 60 | { 61 | return $this->reader->read($name)->getOrElse(null); 62 | } 63 | 64 | /** 65 | * Set an environment variable. 66 | * 67 | * @param string $name 68 | * @param string $value 69 | * 70 | * @return bool 71 | */ 72 | public function set(string $name, string $value) 73 | { 74 | return $this->writer->write($name, $value); 75 | } 76 | 77 | /** 78 | * Clear an environment variable. 79 | * 80 | * @param string $name 81 | * 82 | * @return bool 83 | */ 84 | public function clear(string $name) 85 | { 86 | return $this->writer->delete($name); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php: -------------------------------------------------------------------------------- 1 | 42 | */ 43 | public static function read(array $filePaths, bool $shortCircuit = true, string $fileEncoding = null) 44 | { 45 | $output = []; 46 | 47 | foreach ($filePaths as $filePath) { 48 | $content = self::readFromFile($filePath, $fileEncoding); 49 | if ($content->isDefined()) { 50 | $output[$filePath] = $content->get(); 51 | if ($shortCircuit) { 52 | break; 53 | } 54 | } 55 | } 56 | 57 | return $output; 58 | } 59 | 60 | /** 61 | * Read the given file. 62 | * 63 | * @param string $path 64 | * @param string|null $encoding 65 | * 66 | * @throws \Dotenv\Exception\InvalidEncodingException 67 | * 68 | * @return \PhpOption\Option 69 | */ 70 | private static function readFromFile(string $path, string $encoding = null) 71 | { 72 | /** @var Option */ 73 | $content = Option::fromValue(@\file_get_contents($path), false); 74 | 75 | return $content->flatMap(static function (string $content) use ($encoding) { 76 | return Str::utf8($content, $encoding)->mapError(static function (string $error) { 77 | throw new InvalidEncodingException($error); 78 | })->success(); 79 | }); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Store/FileStore.php: -------------------------------------------------------------------------------- 1 | filePaths = $filePaths; 45 | $this->shortCircuit = $shortCircuit; 46 | $this->fileEncoding = $fileEncoding; 47 | } 48 | 49 | /** 50 | * Read the content of the environment file(s). 51 | * 52 | * @throws \Dotenv\Exception\InvalidEncodingException|\Dotenv\Exception\InvalidPathException 53 | * 54 | * @return string 55 | */ 56 | public function read() 57 | { 58 | if ($this->filePaths === []) { 59 | throw new InvalidPathException('At least one environment file path must be provided.'); 60 | } 61 | 62 | $contents = Reader::read($this->filePaths, $this->shortCircuit, $this->fileEncoding); 63 | 64 | if (\count($contents) > 0) { 65 | return \implode("\n", $contents); 66 | } 67 | 68 | throw new InvalidPathException( 69 | \sprintf('Unable to read any of the environment file(s) at [%s].', \implode(', ', $this->filePaths)) 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Store/StoreInterface.php: -------------------------------------------------------------------------------- 1 | content = $content; 26 | } 27 | 28 | /** 29 | * Read the content of the environment file(s). 30 | * 31 | * @return string 32 | */ 33 | public function read() 34 | { 35 | return $this->content; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Util/Regex.php: -------------------------------------------------------------------------------- 1 | 34 | */ 35 | public static function matches(string $pattern, string $subject) 36 | { 37 | return self::pregAndWrap(static function (string $subject) use ($pattern) { 38 | return @\preg_match($pattern, $subject) === 1; 39 | }, $subject); 40 | } 41 | 42 | /** 43 | * Perform a preg match all, wrapping up the result. 44 | * 45 | * @param string $pattern 46 | * @param string $subject 47 | * 48 | * @return \GrahamCampbell\ResultType\Result 49 | */ 50 | public static function occurences(string $pattern, string $subject) 51 | { 52 | return self::pregAndWrap(static function (string $subject) use ($pattern) { 53 | return (int) @\preg_match_all($pattern, $subject); 54 | }, $subject); 55 | } 56 | 57 | /** 58 | * Perform a preg replace callback, wrapping up the result. 59 | * 60 | * @param string $pattern 61 | * @param callable $callback 62 | * @param string $subject 63 | * @param int|null $limit 64 | * 65 | * @return \GrahamCampbell\ResultType\Result 66 | */ 67 | public static function replaceCallback(string $pattern, callable $callback, string $subject, int $limit = null) 68 | { 69 | return self::pregAndWrap(static function (string $subject) use ($pattern, $callback, $limit) { 70 | return (string) @\preg_replace_callback($pattern, $callback, $subject, $limit ?? -1); 71 | }, $subject); 72 | } 73 | 74 | /** 75 | * Perform a preg split, wrapping up the result. 76 | * 77 | * @param string $pattern 78 | * @param string $subject 79 | * 80 | * @return \GrahamCampbell\ResultType\Result 81 | */ 82 | public static function split(string $pattern, string $subject) 83 | { 84 | return self::pregAndWrap(static function (string $subject) use ($pattern) { 85 | /** @var string[] */ 86 | return (array) @\preg_split($pattern, $subject); 87 | }, $subject); 88 | } 89 | 90 | /** 91 | * Perform a preg operation, wrapping up the result. 92 | * 93 | * @template V 94 | * 95 | * @param callable(string):V $operation 96 | * @param string $subject 97 | * 98 | * @return \GrahamCampbell\ResultType\Result 99 | */ 100 | private static function pregAndWrap(callable $operation, string $subject) 101 | { 102 | $result = $operation($subject); 103 | 104 | if (\preg_last_error() !== \PREG_NO_ERROR) { 105 | return Error::create(\preg_last_error_msg()); 106 | } 107 | 108 | return Success::create($result); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Util/Str.php: -------------------------------------------------------------------------------- 1 | 35 | */ 36 | public static function utf8(string $input, string $encoding = null) 37 | { 38 | if ($encoding !== null && !\in_array($encoding, \mb_list_encodings(), true)) { 39 | /** @var \GrahamCampbell\ResultType\Result */ 40 | return Error::create( 41 | \sprintf('Illegal character encoding [%s] specified.', $encoding) 42 | ); 43 | } 44 | 45 | /** @var \GrahamCampbell\ResultType\Result */ 46 | return Success::create( 47 | $encoding === null ? @\mb_convert_encoding($input, 'UTF-8') : @\mb_convert_encoding($input, 'UTF-8', $encoding) 48 | ); 49 | } 50 | 51 | /** 52 | * Search for a given substring of the input. 53 | * 54 | * @param string $haystack 55 | * @param string $needle 56 | * 57 | * @return \PhpOption\Option 58 | */ 59 | public static function pos(string $haystack, string $needle) 60 | { 61 | /** @var \PhpOption\Option */ 62 | return Option::fromValue(\mb_strpos($haystack, $needle, 0, 'UTF-8'), false); 63 | } 64 | 65 | /** 66 | * Grab the specified substring of the input. 67 | * 68 | * @param string $input 69 | * @param int $start 70 | * @param int|null $length 71 | * 72 | * @return string 73 | */ 74 | public static function substr(string $input, int $start, int $length = null) 75 | { 76 | return \mb_substr($input, $start, $length, 'UTF-8'); 77 | } 78 | 79 | /** 80 | * Compute the length of the given string. 81 | * 82 | * @param string $input 83 | * 84 | * @return int 85 | */ 86 | public static function len(string $input) 87 | { 88 | return \mb_strlen($input, 'UTF-8'); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /views/errors/404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |

404

12 |

LOST IN SPACE ? Hmm, looks like that page doesn't exist.

13 | 14 | 15 |
16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /views/home.php: -------------------------------------------------------------------------------- 1 |
2 |

Welcome to

3 | 4 | 5 | Go To the documentation 7 |
8 | -------------------------------------------------------------------------------- /views/layouts/app.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <?= env('APP_NAME'); ?> 10 | 11 | 12 | 13 |
14 | {{content}} 15 |
16 | 17 | 18 | 19 | 20 | 21 | --------------------------------------------------------------------------------