Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/rentpix.corals.io/vendor/orchestra/testbench-core/src/Concerns/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/rentpix.corals.io/vendor/orchestra/testbench-core/src/Concerns/HandlesAttributes.php
<?php

namespace Orchestra\Testbench\Concerns;

use Illuminate\Support\Collection;
use Orchestra\Testbench\Contracts\Attributes\Actionable as ActionableContract;
use Orchestra\Testbench\Contracts\Attributes\Invokable as InvokableContract;
use Orchestra\Testbench\Features\FeaturesCollection;

/**
 * @internal
 *
 * @phpstan-import-type TTestingFeature from \Orchestra\Testbench\PHPUnit\AttributeParser
 */
trait HandlesAttributes
{
    /**
     * Parse test method attributes.
     *
     * @param  \Illuminate\Foundation\Application  $app
     * @param  class-string  $attribute
     * @return \Orchestra\Testbench\Features\FeaturesCollection<int, mixed>
     */
    protected function parseTestMethodAttributes($app, string $attribute): Collection
    {
        /** @var \Illuminate\Support\Collection<int, mixed> $attributes */
        $attributes = $this->resolvePhpUnitAttributes()
            ->filter(static function ($attributes, string $key) use ($attribute) {
                return $key === $attribute && ! empty($attributes);
            })->flatten()
            ->map(function ($instance) use ($app) {
                if ($instance instanceof InvokableContract) {
                    return $instance($app);
                } elseif ($instance instanceof ActionableContract) {
                    return $instance->handle($app, fn ($method, $parameters) => $this->{$method}(...$parameters));
                }
            })->filter()
            ->values();

        return new FeaturesCollection($attributes);
    }

    /**
     * Resolve PHPUnit method attributes.
     *
     * @phpunit-overrides
     *
     * @return \Illuminate\Support\Collection<class-string<TTestingFeature>, array<int, TTestingFeature>>
     */
    abstract protected function resolvePhpUnitAttributes(): Collection;
}

Spamworldpro Mini