public function injectLine($contents, $lineToAdd)
    {
        if (strpos($contents, self::PLACEHOLDER) === false) {
            throw new \RuntimeException('Failed to find placeholder in config file, file might be malformed');
        }

        return str_replace(self::PLACEHOLDER, $lineToAdd."\n".self::PLACEHOLDER, $contents);
    }
public function injectLine($contents, $lineToAdd)
    {
        if (strpos($contents, self::PLACEHOLDER) === false) {
            throw new \RuntimeException('Failed to find placeholder in config file, file might be malformed');
        }

        return str_replace(self::PLACEHOLDER, $lineToAdd."\n".self::PLACEHOLDER, $contents);
    }
public function injectLine ( $ contents , $ lineToAdd ) { if ( strpos ( $ contents , self :: PLACEHOLDER ) === false ) { throw new \ RuntimeException ( 'Failed to find placeholder in config file, file might be malformed' ) ; } return str_replace ( self :: PLACEHOLDER , $ lineToAdd . "\n" . self :: PLACEHOLDER , $ contents ) ; }
Adds a line of PHP code into the config file.

@param string $contents  The config file contents
@param string $lineToAdd The line to inject

@return string
Adds a line of PHP code into the config file .