Get version

If no "version" value has been set, this method will
set and return a default "version" value,
if any such value is available

@see getDefaultVersion()

@return string|null version or null if no version has been set
765303
public function getVersion() : ?string 
    {
        if ( ! $this->hasVersion()) {
            $this->setVersion($this->getDefaultVersion());
        }
        return $this->version;
    }
151647
public function getVersion() {
        if ($this->version === null) {
            foreach ($this->mapping['properties'] as $name => $property) {
                if (isset($property['version']) && $property['version']===true) {
                    return $this->version = new PropertyMapping($this, $property);
                }
            }
            $this->version = false;
        }
        return $this->version ?: null;
    }
201039
public function getDefaultStringFormat()
    {
        if (!$this->defaultStringFormat && $this->getDatabase() && $this->getDatabase()->getDefaultStringFormat()) {
            return $this->getDatabase()->getDefaultStringFormat();
        }

        return $this->defaultStringFormat;
    }
1002494
public function getVersions()
    {
        while (
            !empty($this->version) &&
            substr_count($this->version, '.') < 2
        ) {
            $this->version .= '.0';
        }
        // Remove part by part of the version.
        $result = array_merge(
            [$this->version],
            $this->explode($this->version, '.')
        );
        asort($result);
        usort($result, function ($a, $b) {
            // PHP 7: Switch to the <=> "Spaceship" operator
            return strlen($b) - strlen($a);
        });
        return $this->filterDuplicates($result);
    }
976029
public function getServerVersion()
    {
        $this->_connect();
        $server_info = db2_server_info($this->_connection);
        if ($server_info !== false) {
            $version = $server_info->DBMS_VER;
            if ($this->_isI5) {
                $version = (int) substr($version, 0, 2) . '.' . (int) substr($version, 2, 2) . '.' . (int) substr($version, 4);
            }
            return $version;
        } else {
            return null;
        }
    }
1038963
private function getVersion(): ?Version
    {
        // Oops, unknown/empty path of a file who contains version
        if (empty($this->versionFilePath)) {
            throw EmptyVersionFilePathException::create();
        }

        // Oops, not readable/accessible file who contains version
        if (!is_readable($this->versionFilePath)) {
            throw UnreadableVersionFileException::create($this->versionFilePath);
        }

        $contents = file_get_contents($this->versionFilePath);

        return Version::fromString($contents);
    }
1047406
public function version()
    {
        $json = (string) $this->client->request('GET', '/')->getBody();
        $value = JSONEncoder::decode($json);

        return $value['version'];
    }
695589
public function getDefault() {
    	if ($this->isPublic() && !$this->isStatic() && $this->refClass->isAbstract() == false) {	    		 
	  		$className = $this->refClass->getName();
	  		// TODO: find a way to get default value for abstract properties.
	  		// TODO: optimize this: we should not have to create one new instance for every property....
	  		/*$instance = new $className();
			$property = $this->getName();
	    	return $instance->$property;*/
	  		
	  		// In some cases, the call to getDefaultProperties can log NOTICES
	  		// in particular if an undefined constant is used as default value.
	  		ob_start();
	  		$defaultProperties = $this->refClass->getDefaultProperties();
	  		$possibleError = ob_get_clean();
			if ($possibleError) {
				throw new \Exception($possibleError);	
			}
	  		return $defaultProperties[$this->getName()];
    	} else {
    		return null;
    	}
    }
387997
public function getVersion()
    {
        if (!isset($this->name)) {
            BrowserDetector::detect($this, $this->getUserAgent());
        }

        return (string) $this->version;
    }
619677
public function getVersionString() {
        if ($this->versionString === null) {
            if (!$this->isConnected())
                $this->connect();
            $this->versionString = pg_version($this->hConnection)['server'];
        }
        return $this->versionString;
    }
563814
public function getCurrentVersion()
    {
        // We don't cache this code as the current version is pretty volatile.
        // TODO - that means they're no point in a setter then?
        // maybe we should cache and call a reset() method every time a migration is run
        $versions = $this->getVersions();
        $version = 0;

        if (!empty($versions)) {
            $version = end($versions);
        }

        $this->setCurrentVersion($version);

        return $this->currentVersion;
    }
349750
public function getDefault() {
		if( is_object($this->default) ) {
			$this->default = call_user_func_array($this->default->type, (array) $this->default->args);
		} else
		if( defined($this->default) ) {
			return constant($this->default);
		}
		return $this->default;
	}
899686
protected String getVersion(String version) {
        return this.version == null || this.version.length() == 0
                ? version
                : this.version;
    }
96967
public function version()
    {
        if ( $this->versionObject === null )
            $this->versionObject = eZContentObjectVersion::fetch( $this->attribute( 'ezcontentobject_version_id' ) );

        return $this->versionObject;
    }
1217537
public function getDefaultValue()
    {
        $default = $this->_default;

        if ($default && !$this->isScalar()) {
            $default = $default instanceof AnDomainAttributeInterface ? clone $default :
                        AnDomainAttribute::getInstance($this->_type);
        }

        return $default;
    }
1028138
public function getPlatformVersion() { 
		if ($this->_platformVersion === self::PLATFORM_UNKNOWN ) 
		{
			$this->_platformVersion = $this->_platform;
		}
		return $this->_platformVersion; 
	}
1103136
protected function getVersion()
    {
        static $version;
        if (!$version) {
            $version = false;
            $string = $this->execute(['--version'], false);
            if ($string && preg_match('/(^| )([0-9]+[^ ]*)/', $string, $matches)) {
                $version = $matches[2];
            }
        }

        return $version;
    }