public function marshall()
    {
        $ctx = $this->getContext();
        $access = $ctx->getStreamAccess();
        $array = $this->getToMarshall();
        $args = new PhpArgumentCollection();

        foreach ($array as $a) {
            if (PhpUtils::isScalar($a) === false) {
                $msg = "The PhpArrayMarshaller class only deals with PHP scalar values, object or resource given.";
                throw new PhpMarshallingException($msg);
            }

            $args[] = new PhpArgument($a);
        }

        $arrayVarName = $ctx->generateVariableName($array);
        $access->writeVariable($arrayVarName);
        $access->writeEquals($ctx->mustFormatOutput());
        $access->writeFunctionCall('array', $args);
        $access->writeSemicolon($ctx->mustFormatOutput());

        $ctx->pushOnVariableStack($arrayVarName);
    }
public function marshall()
    {
        $ctx = $this->getContext();
        $access = $ctx->getStreamAccess();
        $array = $this->getToMarshall();
        $args = new PhpArgumentCollection();

        foreach ($array as $a) {
            if (PhpUtils::isScalar($a) === false) {
                $msg = "The PhpArrayMarshaller class only deals with PHP scalar values, object or resource given.";
                throw new PhpMarshallingException($msg);
            }

            $args[] = new PhpArgument($a);
        }

        $arrayVarName = $ctx->generateVariableName($array);
        $access->writeVariable($arrayVarName);
        $access->writeEquals($ctx->mustFormatOutput());
        $access->writeFunctionCall('array', $args);
        $access->writeSemicolon($ctx->mustFormatOutput());

        $ctx->pushOnVariableStack($arrayVarName);
    }
public function marshall ( ) { $ ctx = $ this -> getContext ( ) ; $ access = $ ctx -> getStreamAccess ( ) ; $ array = $ this -> getToMarshall ( ) ; $ args = new PhpArgumentCollection ( ) ; foreach ( $ array as $ a ) { if ( PhpUtils :: isScalar ( $ a ) === false ) { $ msg = "The PhpArrayMarshaller class only deals with PHP scalar values, object or resource given." ; throw new PhpMarshallingException ( $ msg ) ; } $ args [ ] = new PhpArgument ( $ a ) ; } $ arrayVarName = $ ctx -> generateVariableName ( $ array ) ; $ access -> writeVariable ( $ arrayVarName ) ; $ access -> writeEquals ( $ ctx -> mustFormatOutput ( ) ) ; $ access -> writeFunctionCall ( 'array' , $ args ) ; $ access -> writeSemicolon ( $ ctx -> mustFormatOutput ( ) ) ; $ ctx -> pushOnVariableStack ( $ arrayVarName ) ; }
Marshall an array into PHP source code.

@throws \qtism\data\storage\php\marshalling\PhpMarshallingException If something wrong happens during marshalling.
Marshall an array into PHP source code .