O:39:"phpDocumentor\Descriptor\FileDescriptor":22:{s:7:" * hash";s:32:"be7b85b9fbb9f013595fd69dabf91b68";s:7:" * path";s:35:"ConsumerStrategies/FileConsumer.php";s:9:" * source";s:1016:"<?php
require_once(dirname(__FILE__) . "/AbstractConsumer.php");
/**
 * Consumes messages and writes them to a file
 */
class ConsumerStrategies_FileConsumer extends ConsumerStrategies_AbstractConsumer {

    /**
     * @var string path to a file that we want to write the messages to
     */
    private $_file;


    /**
     * Creates a new FileConsumer and assigns properties from the $options array
     * @param array $options
     */
    function __construct($options) {
        parent::__construct($options);

        // what file to write to?
        $this->_file = array_key_exists("file", $options) ? $options['file'] :  dirname(__FILE__)."/../../messages.txt";
    }


    /**
     * Append $batch to a file
     * @param array $batch
     * @return bool
     */
    public function persist($batch) {
        if (count($batch) > 0) {
            return file_put_contents($this->_file, json_encode($batch)."\n", FILE_APPEND | LOCK_EX) !== false;
        } else {
            return true;
        }
    }
}";s:19:" * namespaceAliases";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:11:" * includes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:41:"phpDocumentor\Reflection\IncludeReflector":3:{s:7:" * node";O:28:"PhpParser\Node\Expr\Include_":4:{s:4:"expr";O:35:"PhpParser\Node\Expr\BinaryOp\Concat":4:{s:4:"left";O:28:"PhpParser\Node\Expr\FuncCall":4:{s:4:"name";O:19:"PhpParser\Node\Name":3:{s:5:"parts";a:1:{i:0;s:7:"dirname";}s:36:" PhpParser\NodeAbstract subNodeNames";N;s:13:" * attributes";a:2:{s:9:"startLine";i:2;s:7:"endLine";i:2;}}s:4:"args";a:1:{i:0;O:18:"PhpParser\Node\Arg":5:{s:5:"value";O:37:"PhpParser\Node\Scalar\MagicConst\File":2:{s:36:" PhpParser\NodeAbstract subNodeNames";N;s:13:" * attributes";a:2:{s:9:"startLine";i:2;s:7:"endLine";i:2;}}s:5:"byRef";b:0;s:6:"unpack";b:0;s:36:" PhpParser\NodeAbstract subNodeNames";N;s:13:" * attributes";a:2:{s:9:"startLine";i:2;s:7:"endLine";i:2;}}}s:36:" PhpParser\NodeAbstract subNodeNames";N;s:13:" * attributes";a:2:{s:9:"startLine";i:2;s:7:"endLine";i:2;}}s:5:"right";O:29:"PhpParser\Node\Scalar\String_":3:{s:5:"value";s:21:"/AbstractConsumer.php";s:36:" PhpParser\NodeAbstract subNodeNames";N;s:13:" * attributes";a:3:{s:9:"startLine";i:2;s:7:"endLine";i:2;s:13:"originalValue";s:23:""/AbstractConsumer.php"";}}s:36:" PhpParser\NodeAbstract subNodeNames";N;s:13:" * attributes";a:3:{s:9:"startLine";i:2;s:7:"endLine";i:2;s:13:"originalValue";s:23:""/AbstractConsumer.php"";}}s:4:"type";i:4;s:36:" PhpParser\NodeAbstract subNodeNames";N;s:13:" * attributes";a:3:{s:9:"startLine";i:2;s:7:"endLine";i:2;s:8:"comments";a:0:{}}}s:23:" * default_package_name";s:0:"";s:10:" * context";O:41:"phpDocumentor\Reflection\DocBlock\Context":3:{s:12:" * namespace";s:0:"";s:20:" * namespace_aliases";a:0:{}s:7:" * lsen";s:0:"";}}}}s:12:" * constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:12:" * functions";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:10:" * classes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:32:"\ConsumerStrategies_FileConsumer";O:40:"phpDocumentor\Descriptor\ClassDescriptor":19:{s:9:" * parent";s:36:"\ConsumerStrategies_AbstractConsumer";s:13:" * implements";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:11:" * abstract";b:0;s:8:" * final";b:0;s:12:" * constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:13:" * properties";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:5:"_file";O:43:"phpDocumentor\Descriptor\PropertyDescriptor":16:{s:9:" * parent";r:66;s:8:" * types";N;s:10:" * default";N;s:9:" * static";b:0;s:13:" * visibility";s:7:"private";s:8:" * fqsen";s:39:"\ConsumerStrategies_FileConsumer::_file";s:7:" * name";s:5:"_file";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:17:" * fileDescriptor";N;s:7:" * line";i:11;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:3:"var";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:42:"phpDocumentor\Descriptor\Tag\VarDescriptor":5:{s:15:" * variableName";s:0:"";s:8:" * types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:46:"phpDocumentor\Descriptor\Type\StringDescriptor":0:{}}}s:7:" * name";s:3:"var";s:14:" * description";s:52:"path to a file that we want to write the messages to";s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:19:" * inheritedElement";N;}}}s:10:" * methods";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:11:"__construct";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:" * parent";r:66;s:11:" * abstract";b:0;s:8:" * final";b:0;s:9:" * static";b:0;s:13:" * visibility";s:6:"public";s:12:" * arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:8:"$options";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":16:{s:9:" * method";r:108;s:8:" * types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:" * name";s:5:"array";}}}s:10:" * default";N;s:14:" * byReference";b:0;s:13:" * isVariadic";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:8:"$options";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:17:" * fileDescriptor";N;s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:19:" * inheritedElement";N;}}}s:8:" * fqsen";s:47:"\ConsumerStrategies_FileConsumer::__construct()";s:7:" * name";s:11:"__construct";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:73:"Creates a new FileConsumer and assigns properties from the $options array";s:14:" * description";s:0:"";s:17:" * fileDescriptor";N;s:7:" * line";i:18;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:15:" * variableName";s:8:"$options";s:8:" * types";r:118;s:7:" * name";s:5:"param";s:14:" * description";s:0:"";s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:19:" * inheritedElement";N;}s:7:"persist";O:41:"phpDocumentor\Descriptor\MethodDescriptor":17:{s:9:" * parent";r:66;s:11:" * abstract";b:0;s:8:" * final";b:0;s:9:" * static";b:0;s:13:" * visibility";s:6:"public";s:12:" * arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{s:6:"$batch";O:43:"phpDocumentor\Descriptor\ArgumentDescriptor":16:{s:9:" * method";r:162;s:8:" * types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:51:"phpDocumentor\Descriptor\Type\UnknownTypeDescriptor":1:{s:7:" * name";s:5:"array";}}}s:10:" * default";N;s:14:" * byReference";b:0;s:13:" * isVariadic";b:0;s:8:" * fqsen";s:0:"";s:7:" * name";s:6:"$batch";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:17:" * fileDescriptor";N;s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:19:" * inheritedElement";N;}}}s:8:" * fqsen";s:43:"\ConsumerStrategies_FileConsumer::persist()";s:7:" * name";s:7:"persist";s:12:" * namespace";N;s:10:" * package";s:0:"";s:10:" * summary";s:23:"Append $batch to a file";s:14:" * description";s:0:"";s:17:" * fileDescriptor";N;s:7:" * line";i:31;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:5:"param";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:44:"phpDocumentor\Descriptor\Tag\ParamDescriptor":5:{s:15:" * variableName";s:6:"$batch";s:8:" * types";r:172;s:7:" * name";s:5:"param";s:14:" * description";s:0:"";s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\ReturnDescriptor":4:{s:8:" * types";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:47:"phpDocumentor\Descriptor\Type\BooleanDescriptor":0:{}}}s:7:" * name";s:6:"return";s:14:" * description";s:0:"";s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:19:" * inheritedElement";N;}}}s:13:" * usedTraits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:8:" * fqsen";s:32:"\ConsumerStrategies_FileConsumer";s:7:" * name";s:31:"ConsumerStrategies_FileConsumer";s:12:" * namespace";s:0:"";s:10:" * package";s:0:"";s:10:" * summary";s:43:"Consumes messages and writes them to a file";s:14:" * description";s:0:"";s:17:" * fileDescriptor";r:1;s:7:" * line";i:6;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:7:"package";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:" * name";s:7:"package";s:14:" * description";s:7:"Default";s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:10:"subpackage";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:19:" * inheritedElement";N;}}}s:13:" * interfaces";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * traits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:10:" * markers";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:8:" * fqsen";s:0:"";s:7:" * name";s:16:"FileConsumer.php";s:12:" * namespace";N;s:10:" * package";s:7:"Default";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:17:" * fileDescriptor";N;s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:7:"package";r:236;s:10:"subpackage";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50000";s:7:" * line";i:0;s:10:" * context";a:2:{s:11:"{{ value }}";s:2:"""";i:0;s:0:"";}}}}s:19:" * inheritedElement";N;}