Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 150
Zeile 23... Zeile 23...
23
    /**
23
    /**
24
     * @var string
24
     * @var string
25
     */
25
     */
26
    protected $idRight = '';
26
    protected $idRight = '';
Zeile 27... Zeile 27...
27
 
27
 
28
    public function parse(string $str) : Result
28
    public function parse(string $str): Result
29
    {
29
    {
Zeile 30... Zeile 30...
30
        $result = parent::parse($str);
30
        $result = parent::parse($str);
Zeile 31... Zeile 31...
31
 
31
 
32
        $this->addLongEmailWarning($this->idLeft, $this->idRight);
32
        $this->addLongEmailWarning($this->idLeft, $this->idRight);
33
 
33
 
34
        return $result;
34
        return $result;
35
    }
35
    }
36
    
36
 
37
    protected function preLeftParsing(): Result
37
    protected function preLeftParsing(): Result
38
    {
38
    {
39
        if (!$this->hasAtToken()) {
39
        if (!$this->hasAtToken()) {
40
            return new InvalidEmail(new NoLocalPart(), $this->lexer->token["value"]);
40
            return new InvalidEmail(new NoLocalPart(), $this->lexer->current->value);
Zeile 41... Zeile 41...
41
        }
41
        }
Zeile 50... Zeile 50...
50
    protected function parseRightFromAt(): Result
50
    protected function parseRightFromAt(): Result
51
    {
51
    {
52
        return $this->processIDRight();
52
        return $this->processIDRight();
53
    }
53
    }
Zeile 54... Zeile 54...
54
 
54
 
55
    private function processIDLeft() : Result
55
    private function processIDLeft(): Result
56
    {
56
    {
57
        $localPartParser = new IDLeftPart($this->lexer);
57
        $localPartParser = new IDLeftPart($this->lexer);
58
        $localPartResult = $localPartParser->parse();
58
        $localPartResult = $localPartParser->parse();
59
        $this->idLeft = $localPartParser->localPart();
59
        $this->idLeft = $localPartParser->localPart();
Zeile 60... Zeile 60...
60
        $this->warnings = array_merge($localPartParser->getWarnings(), $this->warnings);
60
        $this->warnings = array_merge($localPartParser->getWarnings(), $this->warnings);
61
 
61
 
Zeile 62... Zeile 62...
62
        return $localPartResult;
62
        return $localPartResult;
63
    }
63
    }
64
 
64
 
65
    private function processIDRight() : Result
65
    private function processIDRight(): Result
66
    {
66
    {
67
        $domainPartParser = new IDRightPart($this->lexer);
67
        $domainPartParser = new IDRightPart($this->lexer);
68
        $domainPartResult = $domainPartParser->parse();
68
        $domainPartResult = $domainPartParser->parse();
69
        $this->idRight = $domainPartParser->domainPart();
69
        $this->idRight = $domainPartParser->domainPart();
70
        $this->warnings = array_merge($domainPartParser->getWarnings(), $this->warnings);
70
        $this->warnings = array_merge($domainPartParser->getWarnings(), $this->warnings);
Zeile 71... Zeile 71...
71
        
71
 
72
        return $domainPartResult;
72
        return $domainPartResult;
73
    }
73
    }
74
 
74
 
Zeile 75... Zeile 75...
75
    public function getLeftPart() : string
75
    public function getLeftPart(): string
76
    {
76
    {
77
        return $this->idLeft;
77
        return $this->idLeft;
78
    }
78
    }
Zeile 79... Zeile 79...
79
 
79
 
80
    public function getRightPart() : string
80
    public function getRightPart(): string
81
    {
81
    {
82
        return $this->idRight;
82
        return $this->idRight;
83
    }
83
    }
84
 
84