Command/OutputCommand.php
private function executeSend(InputInterface $input, OutputInterface $output)
    {
        $message = $input->getOption(self::OPTION_SEND);
        $output->writeln(sprintf(self::WELCOME_SEND, $message, $this->getName()));

        $port = file_get_contents($this->getFilePath());

        $pingSock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
        socket_sendto($pingSock, $message . PHP_EOL, strlen($message), 0, '127.0.0.1', $port);
    }
private function executeSend(InputInterface $input, OutputInterface $output)
    {
        $message = $input->getOption(self::OPTION_SEND);
        $output->writeln(sprintf(self::WELCOME_SEND, $message, $this->getName()));

        $port = file_get_contents($this->getFilePath());

        $pingSock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
        socket_sendto($pingSock, $message . PHP_EOL, strlen($message), 0, '127.0.0.1', $port);
    }
private function executeSend ( InputInterface $ input , OutputInterface $ output ) { $ message = $ input -> getOption ( self :: OPTION_SEND ) ; $ output -> writeln ( sprintf ( self :: WELCOME_SEND , $ message , $ this -> getName ( ) ) ) ; $ port = file_get_contents ( $ this -> getFilePath ( ) ) ; $ pingSock = socket_create ( AF_INET , SOCK_DGRAM , SOL_UDP ) ; socket_sendto ( $ pingSock , $ message . PHP_EOL , strlen ( $ message ) , 0 , '127.0.0.1' , $ port ) ; }
Execute send mode with send option

@param \Symfony\Component\Console\Input\InputInterface   $input
@param \Symfony\Component\Console\Output\OutputInterface $output
Execute send mode with send option