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 22... Zeile 22...
22
    /**
22
    /**
23
     * @var string
23
     * @var string
24
     */
24
     */
25
    protected $localPart = '';
25
    protected $localPart = '';
Zeile 26... Zeile 26...
26
 
26
 
27
    public function parse(string $str) : Result
27
    public function parse(string $str): Result
28
    {
28
    {
Zeile 29... Zeile 29...
29
        $result = parent::parse($str);
29
        $result = parent::parse($str);
Zeile 30... Zeile 30...
30
 
30
 
31
        $this->addLongEmailWarning($this->localPart, $this->domainPart);
31
        $this->addLongEmailWarning($this->localPart, $this->domainPart);
32
 
32
 
33
        return $result;
33
        return $result;
34
    }
34
    }
35
    
35
 
36
    protected function preLeftParsing(): Result
36
    protected function preLeftParsing(): Result
37
    {
37
    {
38
        if (!$this->hasAtToken()) {
38
        if (!$this->hasAtToken()) {
39
            return new InvalidEmail(new NoLocalPart(), $this->lexer->token["value"]);
39
            return new InvalidEmail(new NoLocalPart(), $this->lexer->current->value);
Zeile 40... Zeile 40...
40
        }
40
        }
Zeile 49... Zeile 49...
49
    protected function parseRightFromAt(): Result
49
    protected function parseRightFromAt(): Result
50
    {
50
    {
51
        return $this->processDomainPart();
51
        return $this->processDomainPart();
52
    }
52
    }
Zeile 53... Zeile 53...
53
 
53
 
54
    private function processLocalPart() : Result
54
    private function processLocalPart(): Result
55
    {
55
    {
56
        $localPartParser = new LocalPart($this->lexer);
56
        $localPartParser = new LocalPart($this->lexer);
57
        $localPartResult = $localPartParser->parse();
57
        $localPartResult = $localPartParser->parse();
58
        $this->localPart = $localPartParser->localPart();
58
        $this->localPart = $localPartParser->localPart();
Zeile 59... Zeile 59...
59
        $this->warnings = array_merge($localPartParser->getWarnings(), $this->warnings);
59
        $this->warnings = array_merge($localPartParser->getWarnings(), $this->warnings);
60
 
60
 
Zeile 61... Zeile 61...
61
        return $localPartResult;
61
        return $localPartResult;
62
    }
62
    }
63
 
63
 
64
    private function processDomainPart() : Result
64
    private function processDomainPart(): Result
65
    {
65
    {
66
        $domainPartParser = new DomainPart($this->lexer);
66
        $domainPartParser = new DomainPart($this->lexer);
67
        $domainPartResult = $domainPartParser->parse();
67
        $domainPartResult = $domainPartParser->parse();
68
        $this->domainPart = $domainPartParser->domainPart();
68
        $this->domainPart = $domainPartParser->domainPart();
69
        $this->warnings = array_merge($domainPartParser->getWarnings(), $this->warnings);
69
        $this->warnings = array_merge($domainPartParser->getWarnings(), $this->warnings);
Zeile 70... Zeile 70...
70
        
70
 
71
        return $domainPartResult;
71
        return $domainPartResult;
72
    }
72
    }
73
 
73
 
Zeile 74... Zeile 74...
74
    public function getDomainPart() : string
74
    public function getDomainPart(): string
75
    {
75
    {
76
        return $this->domainPart;
76
        return $this->domainPart;
77
    }
77
    }
Zeile 78... Zeile 78...
78
 
78
 
79
    public function getLocalPart() : string
79
    public function getLocalPart(): string
80
    {
80
    {
81
        return $this->localPart;
81
        return $this->localPart;
82
    }
82
    }
83
 
83