Gets and sets the extension field.

@param null $var

@return null|string
976887
public function extension($var = null)
    {
        if ($var !== null) {
            $this->extension = $var;
        }
        if (empty($this->extension)) {
            $this->extension = '.' . pathinfo($this->name(), PATHINFO_EXTENSION);
        }

        return $this->extension;
    }
175535
public function getParam($var = null)
    {
        $param = $this->_parameters;
        if (null !== $var) {
            if (isset($this->_parameters[$var])) {
                $param = $this->_parameters[$var];
            } else {
                $param = null;
            }
        }

        return $param;
    }
1062504
public function setLabel($var)
    {
        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto_Label::class);
        $this->label = $var;
        $this->has_label = true;

        return $this;
    }
115546
public function getParam($var = null)
    {
        $param = [
            'left'      => $this->getLeftnode(),
            'right'     => $this->getRightnode(),
            'level'     => $this->getLevel(),
            'position'  => $this->getPosition(),
        ];

        if (null !== $var) {
            if (false === array_key_exists($var, $param)) {
                return;
            }

            return $param[$var];
        }

        return $param;
    }
1257837
public function get(string $var){
		$var = strtoupper($var);
		$env = null;

		if($this->global === true){

			if(array_key_exists($var, $_ENV)){
				$env = $_ENV[$var];
			}
			elseif(function_exists('getenv')){
				$env = getenv($var);
			}
			// @codeCoverageIgnoreStart
			elseif(function_exists('apache_getenv')){
				/** @noinspection PhpComposerExtensionStubsInspection */
				$env = apache_getenv($var);
			}
			// @codeCoverageIgnoreEnd

		}

		return $env ?? $this->_ENV[$var] ?? null;
	}
1213588
function variable( $var, $fallbackValue = null )
    {
        if ( isset( $_POST[$var] ) )
        {
            return $_POST[$var];
        }
        else if ( isset( $_GET[$var] ) )
        {
            return $_GET[$var];
        }
        $ret = $fallbackValue;
        if ( $ret === null )
        {
            eZDebug::writeWarning( "Undefined post/get variable: $var",
                                   "eZHTTPTool" );
        }
        return $ret;
    }
895566
private function getShownExtension()
    {
        if($this->hasRequestParameter('shownExtension')){
            $shownExtension = $this->getRequestParameter('shownExtension');
            if(strlen(trim($shownExtension)) > 0){
                $extension = $this->getExtension($shownExtension);
                return $extension->getName();
            }
        }
        return null;
    }
1082785
public function taxonomy($var = null)
    {
        if ($var !== null) {
            // make sure first level are arrays
            array_walk($var, function(&$value) {
                $value = (array) $value;
            });
            // make sure all values are strings
            array_walk_recursive($var, function(&$value) {
                $value = (string) $value;
            });
            $this->taxonomy = $var;
        }

        return $this->taxonomy;
    }
824346
public function getProperty($var = null)
    {
        if (null === $var) {
            return $this->properties;
        }

        if (isset($this->properties[$var])) {
            return $this->properties[$var];
        }

        return;
    }
1247601
public function setExtensionRange($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class);
        $this->extension_range = $arr;
        $this->has_extension_range = true;

        return $this;
    }
748828
protected function varToString($var)
    {
        if (is_object($var)) {
            return get_class($var);
        }

        if (is_array($var)) {
            return 'Array';
        }

        if (is_resource($var)) {
            return sprintf('Resource(%s)', get_resource_type($var));
        }

        if (null === $var) {
            return 'null';
        }

        if (false === $var) {
            return 'false';
        }

        if (true === $var) {
            return 'true';
        }

        return (string) gettype($var);
    }
525407
public function date($var = null)
    {
        if ($var !== null) {
            $this->date = Utils::date2timestamp($var, $this->dateformat);
        }

        if (!$this->date) {
            $this->date = $this->modified;
        }

        return $this->date;
    }
933871
public function env(string $var, $default = null)
    {
        $value = getenv($var) ?? null;

        if ($value === false) {
            return $default instanceof Closure ? $default() : $default;
        }

        switch (strtolower($value)) {
            case 'true':
            case '(true)':
                return true;
            case 'false':
            case '(false)':
                return false;
            case 'empty':
            case '(empty)':
                return '';
            case 'null':
            case '(null)':
                return null;
        }

        if (
            strlen($value) > 1
            && (0 === strpos($value, '"'))
            && (strlen($value) - 1 === strpos($value, '"'))
        ) {
            return substr($value, 1, -1);
        }

        return $value;
    }
1255700
public static function getAsString($var)
    {
        if ($var instanceof Exception) {
            return (string)$var;
        } elseif (is_object($var)) {
            return self::getObjectAsString($var);
        } elseif (is_array($var)) {
            return print_r($var, true);
        } elseif (is_resource($var)) {
            return (string)sprintf('resource(type=%s)', get_resource_type($var));
        } elseif (true === $var) {
            return 'true';
        } elseif (false === $var) {
            return 'false';
        } elseif (null === $var) {
            return 'null';
        }

        return (string)$var;
    }
294044
public function eTag($var = null)
    {
        if ($var !== null) {
            $this->etag = $var;
        }
        if (!isset($this->etag)) {
            $this->etag = (bool)Grav::instance()['config']->get('system.pages.etag');
        }

        return $this->etag;
    }
41563
public function slug($var = null)
    {
        if ($var !== null && $var !== '') {
            $this->slug = $var;
        }

        if (empty($this->slug)) {
            $this->slug = $this->adjustRouteCase(preg_replace(PAGE_ORDER_PREFIX_REGEX, '', $this->folder)) ?: null;
        }

        return $this->slug;
    }
383883
public function tag($name = null, $value = null) 
	{
		Argument::i()
			->test(1, 'string', 'null')
			->test(2, 'scalar', 'null');
			
		$field = Tag::i();
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		if(!is_null($value)) {
			$field->setValue($value);
		}
		
		return $field;
	}