Workaround AD special cases with the unicodePwd attribute...

@link https://support.microsoft.com/en-us/kb/263991
@param AddOperation $operation
6492
protected function unicodePwdHack(AddOperation $operation)
    {
        if (!$this->isUnicodePwdHackNeeded()) {
            return;
        }
        $attributes = $operation->getAttributes();

        foreach ($attributes as $attribute => $value) {
            if (strtolower($attribute) !== 'unicodepwd') {
                continue;
            }
            $value = is_array($value) ? reset($value) : $value;
            $attributes[$attribute] = base64_encode($value);
        }

        $operation->setAttributes($attributes);
    }
497160
protected function doCall($operation)
    {
        $this->client->send($operation);
        $result = $this->client->recv();
        if(false === $result)
        {
            return false;
        }
        if(null === $result->throwable)
        {
            return $result->result;
        }
        else
        {
            throw $result->throwable;
        }
    }
1094551
private function validateOperator(string $operator)
    {
        if (!in_array($operator, self::VALID_OPERATORS)) {
            throw new \InvalidArgumentException(sprintf(
                '%s is not a valid operator'
            ), $operator);
        }
    }
54927
public function addOperation(OperationInterface $operation)
    {
        $this->operations[$operation->getName()] = $operation->setServiceDescription($this);

        return $this;
    }
937956
public function setOperator($operator)
    {
        if (!$operator) {
            $operator = '==';
        }

        if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) {
            throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
        }

        $this->operator = $operator;
    }
198629
public function whyCantDo($operation)
    {
        if (!is_string($operation)) {
            return 'Invalid $operation';
        }
        if (!isset($this->operationErrors[$operation])) {
            switch ($operation) {
                case static::OPERATION_MOVE:
                    $error = $this->whyCantMove();
                    break;
                case static::OPERATION_ALIAS:
                    $error = $this->whyCantAlias();
                    break;
                case static::OPERATION_COPY:
                    $error = $this->whyCantCopy();
                    break;
                case static::OPERATION_COPYALL:
                    $error = $this->whyCantDo(static::OPERATION_COPY);
                    if ($error === '') {
                        $error = $this->whyCantCopyAll();
                    }
                    break;
                case static::OPERATION_COPYVERSION:
                    $error = $this->whyCantCopyVersion();
                    break;
                default:
                    return 'Invalid $operation';
            }
            $this->operationErrors[$operation] = $error;
        }

        return $this->operationErrors[$operation];
    }
246040
protected function hydrateOperation(BatchModifyOperation $operation, $type)
    {
        $this->hydrator->setOperationType(AttributeConverterInterface::TYPE_MODIFY);
        $this->hydrator->setLdapObjectSchema($type ? $this->schemaFactory->get($this->connection->getConfig()->getSchemaName(), $type) : null);
        $this->hydrator->hydrateToLdap($operation);
        $this->hydrator->setLdapObjectSchema(null);
    }
206177
public function removeOperation(\CampaignChain\CoreBundle\Entity\Operation $operations)
    {
        $this->operations->removeElement($operations);
    }
706430
function getOperationData($operation, $bindingType = 'soap')
    {
        if ($bindingType == 'soap') {
            $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
        } elseif ($bindingType == 'soap12') {
            $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
        }
        // loop thru ports
        foreach ($this->ports as $port => $portData) {
            // binding type of port matches parameter
            if ($portData['bindingType'] == $bindingType) {
                // get binding
                //foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
                foreach (array_keys($this->bindings[$portData['binding']]['operations']) as $bOperation) {
                    // note that we could/should also check the namespace here
                    if ($operation == $bOperation) {
                        $opData = $this->bindings[$portData['binding']]['operations'][$operation];

                        return $opData;
                    }
                }
            }
        }
    }
394471
protected function guardOperand($operand): void
    {
        if (!is_int($operand) && !is_float($operand)) {
            $message = sprintf(
                'Operand must be an integer or float; received (%s) %s',
                gettype($operand),
                VarPrinter::toString($operand)
            );
            throw new DomainException($message);
        }
    }
814663
protected function doOperation( Operator $op ) {
		if ( count( $this->operands ) < 2 ) {
			$op->error( 'missing operand' );
		}
		$right = array_pop( $this->operands );
		$left = array_pop( $this->operands );
		$result = $op->operate( $left, $right );
		$this->operands[] = $result;
	}
854855
public function addOperation(\CampaignChain\CoreBundle\Entity\Operation $operations)
    {
        $this->operations[] = $operations;

        return $this;
    }
585773
public static function doUnaryOperation($operator, &$value)
    {
        if (self::$unaryOperations === null) {
            self::$unaryOperations = [
                    self::BITWISE_NOT   => function (&$i) { return ~$i; },
                    self::NOT           => function (&$i) { return !$i; },
                    self::INCREMENT     => function (&$i) { return $i++; },
                    self::DECREMENT     => function (&$i) { return $i--; },
                    self::PRE_INCREMENT => function (&$i) { return ++$i; },
                    self::PRE_DECREMENT => function (&$i) { return --$i; },
                    self::NEGATION      => function (&$i) { return -$i; },
                    self::PLUS          => function (&$i) { return +$i; },
            ];
        }

        if (!isset(self::$unaryOperations[$operator])) {
            throw new PinqException('Unary operator \'%s\' is not supported', $operator);
        }

        $operation = self::$unaryOperations[$operator];

        return $operation($value);
    }
76617
public function defineInlineOperator(string $operator, callable $transformer)
    {
        unset($this->operators[$operator]);
        $this->inlineOperators[$operator] = $transformer;
    }
155276
private function _CheckErrors($operation, $results)
	{
		if (is_soap_fault($results)) 
			throw new Exception("SOAP Fault: ".$results->faultcode."\n".$results->faultstring."\n", 4);
	}
485835
public function addPostOperation(LdapOperationInterface ...$operations)
    {
        foreach ($operations as $operation) {
            $this->postOperations[] = $operation;
        }

        return $this;
    }
1153144
private static function applyWildAll(&$operator, &$value)
    {
        $positive = !(stripos($operator, '!') !== false || stripos($operator, 'NOT') !== false);
        $operator = $positive ? '*=*' : '*!=*';
        $value_array = str_split(str_replace(' ', '', $value));
        $value = implode('%', $value_array);
    }