!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/alt/php55/usr/share/pear/Symfony/Component/Form/Extension/Validator/ViolationMapper/   drwxr-xr-x
Free 293.9 GB of 429.69 GB (68.4%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ViolationPath.php (6.28 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Form\Extension\Validator\ViolationMapper;

use 
Symfony\Component\Form\Exception\OutOfBoundsException;
use 
Symfony\Component\PropertyAccess\PropertyPath;
use 
Symfony\Component\PropertyAccess\PropertyPathInterface;

/**
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class ViolationPath implements \IteratorAggregatePropertyPathInterface
{
    
/**
     * @var array
     */
    
private $elements = array();

    
/**
     * @var array
     */
    
private $isIndex = array();

    
/**
     * @var array
     */
    
private $mapsForm = array();

    
/**
     * @var string
     */
    
private $pathAsString '';

    
/**
     * @var integer
     */
    
private $length 0;

    
/**
     * Creates a new violation path from a string.
     *
     * @param string $violationPath The property path of a {@link ConstraintViolation}
     *                              object.
     */
    
public function __construct($violationPath)
    {
        
$path = new PropertyPath($violationPath);
        
$elements $path->getElements();
        
$data false;

        for (
$i 0$l count($elements); $i $l; ++$i) {
            if (!
$data) {
                
// The element "data" has not yet been passed
                
if ('children' === $elements[$i] && $path->isProperty($i)) {
                    
// Skip element "children"
                    
++$i;

                    
// Next element must exist and must be an index
                    // Otherwise consider this the end of the path
                    
if ($i >= $l || !$path->isIndex($i)) {
                        break;
                    }

                    
$this->elements[] = $elements[$i];
                    
$this->isIndex[] = true;
                    
$this->mapsForm[] = true;
                } elseif (
'data' === $elements[$i] && $path->isProperty($i)) {
                    
// Skip element "data"
                    
++$i;

                    
// End of path
                    
if ($i >= $l) {
                        break;
                    }

                    
$this->elements[] = $elements[$i];
                    
$this->isIndex[] = $path->isIndex($i);
                    
$this->mapsForm[] = false;
                    
$data true;
                } else {
                    
// Neither "children" nor "data" property found
                    // Consider this the end of the path
                    
break;
                }
            } else {
                
// Already after the "data" element
                // Pick everything as is
                
$this->elements[] = $elements[$i];
                
$this->isIndex[] = $path->isIndex($i);
                
$this->mapsForm[] = false;
            }
        }

        
$this->length count($this->elements);

        
$this->buildString();
    }

    
/**
     * {@inheritdoc}
     */
    
public function __toString()
    {
        return 
$this->pathAsString;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getLength()
    {
        return 
$this->length;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getParent()
    {
        if (
$this->length <= 1) {
            return 
null;
        }

        
$parent = clone $this;

        --
$parent->length;
        
array_pop($parent->elements);
        
array_pop($parent->isIndex);
        
array_pop($parent->mapsForm);

        
$parent->buildString();

        return 
$parent;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getElements()
    {
        return 
$this->elements;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getElement($index)
    {
        if (!isset(
$this->elements[$index])) {
            throw new 
OutOfBoundsException(sprintf('The index %s is not within the violation path'$index));
        }

        return 
$this->elements[$index];
    }

    
/**
     * {@inheritdoc}
     */
    
public function isProperty($index)
    {
        if (!isset(
$this->isIndex[$index])) {
            throw new 
OutOfBoundsException(sprintf('The index %s is not within the violation path'$index));
        }

        return !
$this->isIndex[$index];
    }

    
/**
     * {@inheritdoc}
     */
    
public function isIndex($index)
    {
        if (!isset(
$this->isIndex[$index])) {
            throw new 
OutOfBoundsException(sprintf('The index %s is not within the violation path'$index));
        }

        return 
$this->isIndex[$index];
    }

    
/**
     * Returns whether an element maps directly to a form.
     *
     * Consider the following violation path:
     *
     * <code>
     * children[address].children[office].data.street
     * </code>
     *
     * In this example, "address" and "office" map to forms, while
     * "street does not.
     *
     * @param  integer $index The element index.
     *
     * @return Boolean Whether the element maps to a form.
     *
     * @throws OutOfBoundsException If the offset is invalid.
     */
    
public function mapsForm($index)
    {
        if (!isset(
$this->mapsForm[$index])) {
            throw new 
OutOfBoundsException(sprintf('The index %s is not within the violation path'$index));
        }

        return 
$this->mapsForm[$index];
    }

    
/**
     * Returns a new iterator for this path
     *
     * @return ViolationPathIterator
     */
    
public function getIterator()
    {
        return new 
ViolationPathIterator($this);
    }

    
/**
     * Builds the string representation from the elements.
     */
    
private function buildString()
    {
        
$this->pathAsString '';
        
$data false;

        foreach (
$this->elements as $index => $element) {
            if (
$this->mapsForm[$index]) {
                
$this->pathAsString .= ".children[$element]";
            } elseif (!
$data) {
                
$this->pathAsString .= '.data'.($this->isIndex[$index] ? "[$element]" ".$element");
                
$data true;
            } else {
                
$this->pathAsString .= $this->isIndex[$index] ? "[$element]" ".$element";
            }
        }

        if (
'' !== $this->pathAsString) {
            
// remove leading dot
            
$this->pathAsString substr($this->pathAsString1);
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0987 ]--