@param SourceInterface $source

@return mixed
@throws IgnoreFieldException
767876
public function getValue(SourceInterface $source)
    {
        $value = $this->value;

        if ($this->isTrim) {
            $value = trim($value);
        }

        if ($this->isIgnoreEmpty && empty($value)) {
            throw new IgnoreFieldException();
        }

        return $value;
    }
729668
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $this->mountManager->setLogger($this->logger);
        $source = $input->getArgument('source');
        $destination = $input->getArgument('destination');

        $options = [
            'delete'            => $input->getOption('delete'),
            'ignore_timestamps' => $input->getOption('ignore-timestamps'),
            'excludes'          => $input->getOption('exclude'),
            'includes'          => $input->getOption('include'),
            'batch_size'        => $input->getOption('batch-size'),
        ];
        $this->mountManager->sync($source, $destination, $options);
        return 0;
    }
648959
public static function compact($source, $fields)
    {
        $data = array();
        foreach ($fields as $field) {
            if (isset($source[$field])) $data[$field] = $source[$field];
        }
        return $data;
    }
79341
public function merge(ViewHelpersInterface $source)
    {
        $this->registry  = array_merge($this->registry, $source->getRegistry());
        $this->instances = array_merge($this->instances, $source->getInstances());

        return $this;
    }
1120697
public function setSource($source)
    {
        $sourceAttribute = $this->sourceAttribute;
        return (is_string($sourceAttribute) && !empty($sourceAttribute)) ? $this->$sourceAttribute = $source : null;
    }
236081
protected function findByFilterComponentsSourceSetup( $source )
    {

        // Set source defaults
        if( !( $source & ( self::PERSISTED | self::UNPERSISTED ) ) ) {
            $source += self::PERSISTED + self::UNPERSISTED;
        }

        if( !( $source & ( self::CHANGED | self::UNCHANGED ) ) ) {
            $source += self::CHANGED + self::UNCHANGED;
        }

        if( !( $source & ( self::WITH_CHILDREN | self::NO_CHILDREN ) ) ) {
            $source += self::WITH_CHILDREN;
        }

        if( !( $source & ( Base::DATA | Base::INITIAL ) ) ) {
            $source += Base::DATA;
        }

        return $source;

    }
1071683
public function source($source = null)
    {
        if (!func_num_args()) {
            return $this->_source;
        }
        $this->_source = $source;
        return $this;
    }
185030
protected function castStream($source): StreamInterface
    {
        if ($source instanceof UploadedFileInterface || $source instanceof StreamableInterface) {
            $source = $source->getStream();
        }

        if ($source instanceof StreamInterface) {
            //This step is important to prevent user errors
            $source->rewind();

            return $source;
        }

        if (is_resource($source)) {
            return stream_for($source);
        }

        if (empty($source)) {
            //Guzzle?
            return stream_for('');
        }

        if ($this->isFilename($source)) {
            //Must never pass user string in here, use Stream
            return stream_for(fopen($source, 'rb'));
        }

        //We do not allow source names in a string form
        throw new BucketException(
            "Source must be a valid resource, stream or filename, invalid value given"
        );
    }
763824
public static function source($source = null)
    {
        $ins = new static();
        $ins->source = $source;
        $ins->query = $source;
        if (is_object($source) && (is_a($source, "\Illuminate\Database\Eloquent\Builder") ||
                                  is_a($source, "\Illuminate\Database\Eloquent\Model"))) {
            $ins->model = $source->getModel();
        }
        $ins->cid = $ins->getIdentifier();
        $ins->sniffStatus();
        $ins->sniffAction();

        return $ins;
    }
472889
protected function getConverter(InputInterface $input)
    {
        return $this->getConverterFactory()->get($input->getOption('input-format'), $this->output_format);
    }
339997
protected static function executeFields(ExecutionContext $context, ObjectType $parent, $source, $fields)
    {
        return self::executeFieldsSerially($context, $parent, $source, $fields);
    }
1143631
protected function className(ViewSource $source, ContextInterface $context)
    {
        return sprintf("StemplerView_%s", md5(
            $source->getNamespace() . '.' . $source->getName() . '.' . $context->getID()
        ));
    }
404197
public function addField(FieldInterface $field)
    {
        $this->fields[] = $field;
        $field->setContentType($this);

        return $this;
    }
695007
public function mergeSource(SourceInterface $source): void
    {
        if (array_key_exists($source->sourceId(), $this->sources)) {
            unset($this->sources[$source->sourceId()]);
        } else {
            $this->newSources[$source->sourceId()] = $source;
        }
        $this->sources[$source->sourceId()] = $source;
    }
732596
public function normalize($source)
    {
        $fileSystem = new Filesystem();

        // if the source is a file info, it must exists and be readable
        if ($source instanceof SplFileInfo) {

            if (!$fileSystem->exists($source->getRealPath())) {
                throw new Exception('Unable to find '.$source.' during normalization process');
            }

            // the source is already normalized
            return $source;
        }

        // if the source is not an instance of SplInfo, it should be a string
        if (!is_string($source)) {
            throw new Exception(
                'The source should be a string if it is not an instance of SplInfo (instead of '.gettype($source).')'
            );
        }
        $path = $source;

        // if the file does not exists, try to add the application path before
        if (!$fileSystem->exists($source)) {

            if (!$fileSystem->exists($this->applicationPath.'/'.$source)) {
                throw new Exception(
                    'File '.$source.' not found, searched in '
                    .implode(', ', [$source, $this->applicationPath.'/'.$source])
                );
            }
            $path = $this->applicationPath.'/'.$source;
        }
        // normalize source using SplInfo
        $source = new SplFileInfo($path);

        return $source;
    }
217846
protected function createSingle(array $source)
    {
        $data = [];
        /** @var FieldDescriptor $field */
        foreach ($this->getDescriptor()->getFields() as $field) {
            if (array_key_exists($field->getField(), $source)) {
                $data[$field->getName()] = $source[$field->getField()];
            }
        }
        $class = $this->getDescriptor()->className();
        return new $class($data);
    }
251022
private function getNonExistingFields(Source $source)
    {
        $fields = array();
        $fields += array(
            'send' => array(
                'type' => 'button',
                'value' => $this->t('send_again'),
                'ajax' => array(
                    'service' => 'invoice_add',
                    'parent_type' => $this->source->getType(),
                    'parent_source' => $this->source->getId(),
                    'type' => $source->getType(),
                    'source' => $source->getId(),
                    'value' => 1,
                ),
            ),
        );
        return $fields;
    }