@SuppressWarnings(PHPMD.BooleanArgumentFlag)

@param string $zoneID
@param string $type
@param string $name
@param string $content
@param int $ttl
@param bool $proxied
@param string $priority
@param array $data
@return bool
338079
public function addRecord(
        string $zoneID,
        string $type,
        string $name,
        string $content,
        int $ttl = 0,
        bool $proxied = true,
        string $priority = '',
        array $data = []
    ): bool {
        $options = [
            'type' => $type,
            'name' => $name,
            'content' => $content,
            'proxied' => $proxied
        ];

        if ($ttl > 0) {
            $options['ttl'] = $ttl;
        }

        if (!empty($priority)) {
            $options['priority'] = (int)$priority;
        }
        
        if (!empty($data)) {
            $options['data'] = $data;
        }

        $user = $this->adapter->post('zones/' . $zoneID . '/dns_records', $options);

        $this->body = json_decode($user->getBody());

        if (isset($this->body->result->id)) {
            return true;
        }

        return false;
    }
532591
private static void registerProvider0(ZoneRulesProvider provider) {
        for (String zoneId : provider.provideZoneIds()) {
            Jdk8Methods.requireNonNull(zoneId, "zoneId");
            ZoneRulesProvider old = ZONES.putIfAbsent(zoneId, provider);
            if (old != null) {
                throw new ZoneRulesException(
                    "Unable to register zone as one already registered with that ID: " + zoneId +
                    ", currently loading from provider: " + provider);
            }
        }
    }
279877
public function supports(string $name, string $type): bool
    {
        switch ($type) {
            case DSL::TYPE_QUERY:
                return \in_array($name, $this->queries, true);
            case DSL::TYPE_AGGREGATION:
                return \in_array($name, $this->aggregations, true);
            case DSL::TYPE_SUGGEST:
                return \in_array($name, $this->suggesters, true);
        }

        // disables version check in Facade for custom DSL objects
        return true;
    }
220861
protected function checkZoneIdByAddressId($condition, $data, $key)
    {
        $address = $this->address->get($data['data']['order'][$key]);

        if (empty($address)) {
            return false;
        }

        $fields = array('country_zone_id', 'state_zone_id', 'city_zone_id');

        $ids = array();

        foreach ($fields as $field) {
            $ids[] = $address[$field];
        }

        return $this->compare($ids, $condition['value'], $condition['operator']);
    }
106160
def atlas_zonefile_push_enqueue( zonefile_hash, name, txid, zonefile_data, zonefile_queue=None, con=None, path=None ):
    
    res = False

    bits = atlasdb_get_zonefile_bits( zonefile_hash, path=path, con=con )
    if len(bits) == 0:
        # invalid hash
        return

    with AtlasZonefileQueueLocked(zonefile_queue) as zfq:

        if len(zfq) < MAX_QUEUED_ZONEFILES: 
            zfdata = {
                'zonefile_hash': zonefile_hash,
                'zonefile': zonefile_data,
                'name': name,
                'txid': txid
            }

            zfq.append( zfdata )
            res = True
    
    return res
576798
public function onFrame($data, $type)
    {
        if (!isset($this->route)) {
            return false;
        }
        try {
            $this->route->onWakeup();
            $this->route->onFrame($data, $type);
        } catch (\Exception $e) {
            Daemon::uncaughtExceptionHandler($e);
        }
        if ($this->route) {
            $this->route->onSleep();
        }
        return true;
    }
842374
public function cachePurgeEverything(string $zoneID): bool
    {
        $user = $this->adapter->delete('zones/' . $zoneID . '/purge_cache', ['purge_everything' => true]);

        $this->body = json_decode($user->getBody());

        if (isset($this->body->result->id)) {
            return true;
        }

        return false;
    }
1261482
def create_record(self, dns_type, name, content, **kwargs):
        
        data = {
            'type': dns_type,
            'name': name,
            'content': content
        }
        if kwargs.get('ttl') and kwargs['ttl'] != 1:
            data['ttl'] = kwargs['ttl']
        if kwargs.get('proxied') is True:
            data['proxied'] = True
        else:
            data['proxied'] = False
        content = self.request(
            self.api_url + self.zone['id'] + '/dns_records',
            'post',
            data=data
        )
        print('DNS record successfully created')
        return content['result']
844509
public static function append($zoneName, ...$data)
    {
        if (isset(self::$_zones[$zoneName])) {
            self::flushBuffer();
            call_user_func_array(array(self::$_zones[$zoneName], 'append'), $data);
            return true;
        }
        return false;
    }
57081
public function writeMessageBegin($name, $type, $seqid)
    {
        return $this->concreteProtocol_->writeMessageBegin($name, $type, $seqid);
    }
1166118
protected function _renderNode($type, $name, $data)
    {
        $typeAlias = str_replace(' ', '-', strtolower($type));
        ?>
        <li class="jbchild">
            <div class="jbelement">
                <span class="jbname"><?php echo $name; ?></span>
                (<span class="jbtype jbtype-<?php echo $typeAlias; ?>"><?php echo $type; ?></span>)
                <span class="jbvalue"><?php echo $data; ?></span>
            </div>
        </li>
    <?php
    }
473127
public function flagPost($pid, $type) {
		if(!is_string($pid)) {
			throw new LinkedInException('LinkedIn->flagPost(): bad data passed, $pid must be of type string');
		}
		if(!is_string($type)) {
			throw new LinkedInException('LinkedIn->flagPost(): bad data passed, $like must be of type string');
		}
		//Constructing the xml
		$data = '<?xml version="1.0" encoding="UTF-8"?>';
		switch($type) {
			case 'promotion':
				$data .= '<code>promotion</code>';
				break;
			case 'job':
				$data .= '<code>job</code>';
				break;
			default: 
				throw new LinkedInException('LinkedIn->flagPost(): invalid value for $type, must be one of: "promotion", "job"');
				break;	
		}
		
		// construct and send the request
		$query    = self::_URL_API . '/v1/posts/' . $pid . '/category/code';
		$response = $this->fetch('PUT', $query, $data);
		  
  	/**
     * Check for successful request (a 204 response from LinkedIn server) 
	   * per the documentation linked in method comments above.
	   */
		return $this->checkResponse(204, $response);
	}
987406
public function pageInfo(array $data, $type)
    {
        $form = $this->adminPageInfoForm;
        $form->setHydrator(new HydratorPageInfo());
        $class = $this->collectionOptions->getEntityOptions()->getPageInfo();
        $form->bind(new $class());
        $form->setData($data);
        if (!$form->isValid()) {
            return false;
        }

        /** @var \PServerCore\Entity\PageInfo $pageInfo */
        $pageInfo = $form->getData();
        $pageInfo->setType($type);

        $this->entityManager->persist($pageInfo);
        $this->entityManager->flush();

        return $pageInfo;
    }
971606
public function createPageRule(
        string $zoneID,
        PageRulesTargets $target,
        PageRulesActions $actions,
        bool $active = true,
        int $priority = null
    ): bool {
        $options = [
            'targets' => $target->getArray(),
            'actions' => $actions->getArray()
        ];

        if ($active !== null) {
            $options['status'] = $active == true ? 'active' : 'disabled';
        }

        if ($priority !== null) {
            $options['priority'] = $priority;
        }


        $query = $this->adapter->post('zones/' . $zoneID . '/pagerules', $options);

        $this->body = json_decode($query->getBody());

        if (isset($this->body->result->id)) {
            return true;
        }

        return false;
    }
153242
protected function _postback($name, &$default, $type = NULL)
    {
        if( isset($this->postback['bool']) && $this->postback['bool'] === true )
        {
            $method = ! empty($this->method) ? $this->method : $this->postback['type'];
    
            $this->postback = [];

            if( $type === 'checkbox' || $type === 'radio' )
            {
                if( $method::$name() === $default )
                {
                    $this->checked();
                }    
            }
            else
            {
                $default = Singleton::class('ZN\Validation\Data')->postBack($name, $method) ?: $default;
            }   
        }
    }
620811
public function sendFrame($data, $type = 0x00, $cb = null)
    {
        if ($this->finished) {
            return false;
        }
        $this->framesBuffer[] = $data;
        if ($cb !== null) {
            $this->onWrite->push($cb);
        }
        $this->flush();
        return true;
    }
411109
public function zoneId(array $condition, array $data, $key)
    {
        if (isset($data['data']['order'][$key])) {
            return $this->checkZoneIdByAddressId($condition, $data, $key);
        }

        return $this->checkZoneIdByAddressData($condition, $data);
    }