<commit_before><?php

/**
 * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * PHP version 5
 *
 * @category  Microsoft
 * @package   WindowsAzure\Services\Blob\Models
 * @author    <NAME> <<EMAIL>>
 * @copyright 2012 Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 * @link      http://pear.php.net/package/azure-sdk-for-php
 */
 
namespace WindowsAzure\Services\Blob\Models;
use WindowsAzure\Services\Blob\Models\BlobProperties;
use WindowsAzure\Core\WindowsAzureUtilities;
use WindowsAzure\Utilities;

/**
 * Holds result of GetBlob API.
 *
 * @category  Microsoft
 * @package   WindowsAzure\Services\Blob\Models
 * @author    <NAME> <<EMAIL>>
 * @copyright 2012 Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 * @version   Release: @package_version@
 * @link      http://pear.php.net/package/azure-sdk-for-php
 */
class GetBlobResult
{
    /**
     * @var BlobProperties
     */
    private $_properties;
    
    /**
     * @var array
     */
    private $_metadata;
    
    /**
     * @var string
     */
    private $_contentStream;
    
    /**
     * Creates GetBlobResult from getBlob call.
     * 
     * @param array  $headers The HTTP response headers.
     * @param string $body    The response body.
     * 
     * @return GetBlobResult
     */
    public static function create($headers, $body)
    {
        $result   = new GetBlobResult();
        $metadata = WindowsAzureUtilities::getMetadataArray($headers);
        $result->setContentStream(Utilities::stringToStream($body));
        $result->setProperties(BlobProperties::create($headers));
        $result->setMetadata(is_null($metadata) ? array() : $metadata);
        
        return $result;
    }
    
    /**<commit_msg>Change GetBlobResult.php blobStream type to resource.<commit_after><?php

/**
 * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * PHP version 5
 *
 * @category  Microsoft
 * @package   WindowsAzure\Services\Blob\Models
 * @author    <NAME> <<EMAIL>>
 * @copyright 2012 Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 * @link      http://pear.php.net/package/azure-sdk-for-php
 */
 
namespace WindowsAzure\Services\Blob\Models;
use WindowsAzure\Services\Blob\Models\BlobProperties;
use WindowsAzure\Core\WindowsAzureUtilities;
use WindowsAzure\Utilities;

/**
 * Holds result of GetBlob API.
 *
 * @category  Microsoft
 * @package   WindowsAzure\Services\Blob\Models
 * @author    <NAME> <<EMAIL>>
 * @copyright 2012 Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 * @version   Release: @package_version@
 * @link      http://pear.php.net/package/azure-sdk-for-php
 */
class GetBlobResult
{
    /**
     * @var BlobProperties
     */
    private $_properties;
    
    /**
     * @var array
     */
    private $_metadata;
    
    /**
     * @var resource
     */
    private $_contentStream;
    
    /**
     * Creates GetBlobResult from getBlob call.
     * 
     * @param array  $headers The HTTP response headers.
     * @param string $body    The response body.
     * 
     * @return GetBlobResult
     */
    public static function create($headers, $body)
    {
        $result   = new GetBlobResult();
        $metadata = WindowsAzureUtilities::getMetadataArray($headers);
        $result->setContentStream(Utilities::stringToStream($body));
        $result->setProperties(BlobProperties::create($headers));
        $result->setMetadata(is_null($metadata) ? array() : $metadata);
        
        return $result;
    }
    
    /**
{'fraction_non_alphanumeric': 0.1139186295503212, 'fraction_numerical': 0.008993576017130621, 'mean_word_length': 2.965195246179966, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4150006', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1298, 'n_words': 377}