<commit_before><?php

namespace Api\V1\Models\Presenters;

use Carbon\Carbon;
use Tooleks\Laravel\Presenter\Presenter;

/**
 * Class ExifPresenter.
 *
 * @package Api\V1\Models\Presenters
 */
class ExifPresenter extends Presenter
{
    /**
     * @inheritdoc
     */
    protected function getAttributesMap() : array
    {
        return [
            'manufacturer' => 'data.Make',
            'model' => 'data.Model',
            'exposure_time' => function () {
                $exposureTime = $this->getPresenteeAttribute('data.ExposureTime');
                if ($exposureTime) {
                    list($numerator, $denominator) = explode('/', $exposureTime);
                    $exposureTime = '1/' . $denominator / $numerator;
                }
                return $exposureTime ?? null;
            },
            'aperture' => 'data.COMPUTED.ApertureFNumberd',
            'iso' => 'data.ISOSpeedRatings',
            'taken_at' => function () : string {
                return new Carbon($this->getPresenteeAttribute('data.DateTime'));
            },
        ];
    }
}<commit_msg>[BE]. Fixed exif presenter issues<commit_after><?php

namespace Api\V1\Models\Presenters;

use Carbon\Carbon;
use Tooleks\Laravel\Presenter\Presenter;

/**
 * Class ExifPresenter.
 *
 * @package Api\V1\Models\Presenters
 */
class ExifPresenter extends Presenter
{
    /**
     * @inheritdoc
     */
    protected function getAttributesMap() : array
    {
        return [
            'manufacturer' => 'data.Make',
            'model' => 'data.Model',
            'exposure_time' => function () {
                $exposureTime = $this->getPresenteeAttribute('data.ExposureTime');
                if ($exposureTime) {
                    list($numerator, $denominator) = explode('/', $exposureTime);
                    $exposureTime = '1/' . $denominator / $numerator;
                }
                return $exposureTime ?? null;
            },
            'aperture' => 'data.COMPUTED.ApertureFNumber',
            'iso' => 'data.ISOSpeedRatings',
            'taken_at' => function () : string {
                return new Carbon($this->getPresenteeAttribute('data.DateTime'));
            },
        ];
    }
}
{'fraction_non_alphanumeric': 0.13872571170356982, 'fraction_numerical': 0.0027112516945323093, 'mean_word_length': 1.8903394255874673, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6534636', 'n_tokens_mistral': 675, 'n_tokens_neox': 629, 'n_words': 108}