Passed
Push — master ( 811217...98b68e )
by
unknown
12:07
created

FileProcessingAspect::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
namespace TYPO3\CMS\Core\Context;
19
20
use TYPO3\CMS\Core\Context\Exception\AspectPropertyNotFoundException;
21
22
/**
23
 * The aspect contains the processed file representation that is requested to process locally.
24
 *
25
 * Allowed properties:
26
 * - file
27
 */
28
class FileProcessingAspect implements AspectInterface
29
{
30
    /**
31
     * @var bool
32
     */
33
    private $deferProcessing;
34
35
    public function __construct(bool $deferProcessing = true)
36
    {
37
        $this->deferProcessing = $deferProcessing;
38
    }
39
40
    /**
41
     * Fetch the values
42
     *
43
     * @param string $name
44
     * @return bool
45
     * @throws AspectPropertyNotFoundException
46
     */
47
    public function get(string $name)
48
    {
49
        if ($name === 'deferProcessing') {
50
            return $this->deferProcessing;
51
        }
52
        throw new AspectPropertyNotFoundException('Property "' . $name . '" not found in Aspect "' . __CLASS__ . '".', 1599164743);
53
    }
54
55
    public function isProcessingDeferred(): bool
56
    {
57
        return $this->deferProcessing;
58
    }
59
}
60