src/Worker.php
protected function getLocation()
    {
        $matches = array();

        if (!preg_match($this->options['id_location_preg'], $this->getId(), $matches)) {
            throw new Exception('Incompatible ID format: unable to determine worker location');
        }

        if (!isset($matches[1]) || !$matches[1]) {
            throw new Exception('Invalid ID: invalid hostname');
        }

        if (!isset($matches[2]) || !$matches[2] || !is_numeric($matches[2])) {
            throw new Exception('Invalid ID: invalid PID');
        }

        return array($matches[1], (int)$matches[2]);
    }
protected function getLocation()
    {
        $matches = array();

        if (!preg_match($this->options['id_location_preg'], $this->getId(), $matches)) {
            throw new Exception('Incompatible ID format: unable to determine worker location');
        }

        if (!isset($matches[1]) || !$matches[1]) {
            throw new Exception('Invalid ID: invalid hostname');
        }

        if (!isset($matches[2]) || !$matches[2] || !is_numeric($matches[2])) {
            throw new Exception('Invalid ID: invalid PID');
        }

        return array($matches[1], (int)$matches[2]);
    }
protected function getLocation ( ) { $ matches = array ( ) ; if ( ! preg_match ( $ this -> options [ 'id_location_preg' ] , $ this -> getId ( ) , $ matches ) ) { throw new Exception ( 'Incompatible ID format: unable to determine worker location' ) ; } if ( ! isset ( $ matches [ 1 ] ) || ! $ matches [ 1 ] ) { throw new Exception ( 'Invalid ID: invalid hostname' ) ; } if ( ! isset ( $ matches [ 2 ] ) || ! $ matches [ 2 ] || ! is_numeric ( $ matches [ 2 ] ) ) { throw new Exception ( 'Invalid ID: invalid PID' ) ; } return array ( $ matches [ 1 ] , ( int ) $ matches [ 2 ] ) ; }
Parses a hostname and PID out of a string worker ID

If you change the format of the ID, you should also change the definition
of this method.

This method *always* parses the ID of the worker, rather than figuring out
the current processes' PID/hostname. This means you can use setId() to
interrogate the properties of other workers given their ID.

@throws Exception
@return array<string,int>
Parses a hostname and PID out of a string worker ID