src/main/php/de/codenamephp/prototype/utils/answerCollector/FromSerializedArrayFile.php
public function getAnswers(\SplFileInfo $file): array {
    if($file->isReadable()) {
      return unserialize($file->openFile()->fread($file->getSize()));
    }
    throw new \InvalidArgumentException(sprintf('Given file does not exist or is not readable: "%s"', $file->getPathname()));
  }
public function getAnswers(\SplFileInfo $file): array {
    if($file->isReadable()) {
      return unserialize($file->openFile()->fread($file->getSize()));
    }
    throw new \InvalidArgumentException(sprintf('Given file does not exist or is not readable: "%s"', $file->getPathname()));
  }
public function getAnswers ( \ SplFileInfo $ file ) : array { if ( $ file -> isReadable ( ) ) { return unserialize ( $ file -> openFile ( ) -> fread ( $ file -> getSize ( ) ) ) ; } throw new \ InvalidArgumentException ( sprintf ( 'Given file does not exist or is not readable: "%s"' , $ file -> getPathname ( ) ) ) ; }
Checks if the given file is readable. If so, the file is read an unserialized. No further checking of the content is performed!

If the file is not readable (e.g. it does not exist or has no read permissions) a \InvalidArgumentException is thrown.

@param \SplFileInfo $file The file to read the serialized array from
@return array The unserialized array from the file
@throws \InvalidArgumentException if the file is not readable
Checks if the given file is readable . If so the file is read an unserialized . No further checking of the content is performed!