Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Zur aktuellen Revision | 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 268... Zeile 268...
268
     * @codeCoverageIgnore
268
     * @codeCoverageIgnore
269
     *
269
     *
270
     * @throws FatalErrorException
270
     * @throws FatalErrorException
271
     *
271
     *
272
     * @param Stmt $stmt
272
     * @param Stmt $stmt
273
     *
-
 
274
     * @return string
-
 
275
     */
273
     */
276
    protected function getScopeType(Stmt $stmt): string
274
    protected function getScopeType(Stmt $stmt): string
277
    {
275
    {
278
        if ($stmt instanceof Class_) {
276
        if ($stmt instanceof Class_) {
279
            return self::CLASS_TYPE;
277
            return self::CLASS_TYPE;
Zeile 290... Zeile 288...
290
     * Check whether a class exists, or has been defined in the current code snippet.
288
     * Check whether a class exists, or has been defined in the current code snippet.
291
     *
289
     *
292
     * Gives `self`, `static` and `parent` a free pass.
290
     * Gives `self`, `static` and `parent` a free pass.
293
     *
291
     *
294
     * @param string $name
292
     * @param string $name
295
     *
-
 
296
     * @return bool
-
 
297
     */
293
     */
298
    protected function classExists(string $name): bool
294
    protected function classExists(string $name): bool
299
    {
295
    {
300
        // Give `self`, `static` and `parent` a pass. This will actually let
296
        // Give `self`, `static` and `parent` a pass. This will actually let
301
        // some errors through, since we're not checking whether the keyword is
297
        // some errors through, since we're not checking whether the keyword is
Zeile 309... Zeile 305...
309
 
305
 
310
    /**
306
    /**
311
     * Check whether an interface exists, or has been defined in the current code snippet.
307
     * Check whether an interface exists, or has been defined in the current code snippet.
312
     *
308
     *
313
     * @param string $name
-
 
314
     *
-
 
315
     * @return bool
309
     * @param string $name
316
     */
310
     */
317
    protected function interfaceExists(string $name): bool
311
    protected function interfaceExists(string $name): bool
318
    {
312
    {
319
        return \interface_exists($name) || $this->findInScope($name) === self::INTERFACE_TYPE;
313
        return \interface_exists($name) || $this->findInScope($name) === self::INTERFACE_TYPE;
Zeile 320... Zeile 314...
320
    }
314
    }
321
 
315
 
322
    /**
316
    /**
323
     * Check whether a trait exists, or has been defined in the current code snippet.
317
     * Check whether a trait exists, or has been defined in the current code snippet.
324
     *
-
 
325
     * @param string $name
-
 
326
     *
318
     *
327
     * @return bool
319
     * @param string $name
328
     */
320
     */
329
    protected function traitExists(string $name): bool
321
    protected function traitExists(string $name): bool
330
    {
322
    {
Zeile 349... Zeile 341...
349
    /**
341
    /**
350
     * Error creation factory.
342
     * Error creation factory.
351
     *
343
     *
352
     * @param string $msg
344
     * @param string $msg
353
     * @param Stmt   $stmt
345
     * @param Stmt   $stmt
354
     *
-
 
355
     * @return FatalErrorException
-
 
356
     */
346
     */
357
    protected function createError(string $msg, Stmt $stmt): FatalErrorException
347
    protected function createError(string $msg, Stmt $stmt): FatalErrorException
358
    {
348
    {
359
        return new FatalErrorException($msg, 0, \E_ERROR, null, $stmt->getLine());
349
        return new FatalErrorException($msg, 0, \E_ERROR, null, $stmt->getLine());
360
    }
350
    }