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 200
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
3
/*
3
/*
4
 * This file is part of Psy Shell.
4
 * This file is part of Psy Shell.
5
 *
5
 *
6
 * (c) 2012-2022 Justin Hileman
6
 * (c) 2012-2023 Justin Hileman
7
 *
7
 *
8
 * For the full copyright and license information, please view the LICENSE
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
9
 * file that was distributed with this source code.
Zeile 90... Zeile 90...
90
        throw new \InvalidArgumentException('Unknown variable: $'.$name);
90
        throw new \InvalidArgumentException('Unknown variable: $'.$name);
91
    }
91
    }
Zeile 92... Zeile 92...
92
 
92
 
93
    /**
93
    /**
94
     * Get all defined variables.
-
 
95
     *
-
 
96
     * @return array
94
     * Get all defined variables.
97
     */
95
     */
98
    public function getAll(): array
96
    public function getAll(): array
99
    {
97
    {
100
        return \array_merge($this->scopeVariables, $this->getSpecialVariables());
98
        return \array_merge($this->scopeVariables, $this->getSpecialVariables());
Zeile 101... Zeile 99...
101
    }
99
    }
102
 
100
 
103
    /**
-
 
104
     * Get all defined magic variables: $_, $_e, $__out, $__class, $__file, etc.
-
 
105
     *
101
    /**
106
     * @return array
102
     * Get all defined magic variables: $_, $_e, $__out, $__class, $__file, etc.
107
     */
103
     */
108
    public function getSpecialVariables(): array
104
    public function getSpecialVariables(): array
109
    {
105
    {
Zeile 283... Zeile 279...
283
        $this->commandScopeVariables = $vars;
279
        $this->commandScopeVariables = $vars;
284
    }
280
    }
Zeile 285... Zeile 281...
285
 
281
 
286
    /**
282
    /**
287
     * Get command-scope magic variables: $__class, $__file, etc.
-
 
288
     *
-
 
289
     * @return array
283
     * Get command-scope magic variables: $__class, $__file, etc.
290
     */
284
     */
291
    public function getCommandScopeVariables(): array
285
    public function getCommandScopeVariables(): array
292
    {
286
    {
293
        return $this->commandScopeVariables;
287
        return $this->commandScopeVariables;
Zeile 308... Zeile 302...
308
 
302
 
309
    /**
303
    /**
310
     * Check whether a variable name is a magic variable.
304
     * Check whether a variable name is a magic variable.
311
     *
305
     *
312
     * @param string $name
-
 
313
     *
-
 
314
     * @return bool
306
     * @param string $name
315
     */
307
     */
316
    public static function isSpecialVariableName(string $name): bool
308
    public static function isSpecialVariableName(string $name): bool
317
    {
309
    {
318
        return \in_array($name, self::$specialNames) || \in_array($name, self::$commandScopeNames);
310
        return \in_array($name, self::$specialNames) || \in_array($name, self::$commandScopeNames);