PHP 8.3.31
Preview: ApplicationName.php Size: 1.15 KB
/home/getspomw/royalsquad.us/vendor/phar-io/manifest/src/values/ApplicationName.php

<?php declare(strict_types = 1);
/*
 * This file is part of PharIo\Manifest.
 *
 * Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 */
namespace PharIo\Manifest;

use function preg_match;
use function sprintf;

class ApplicationName {
    /** @var string */
    private $name;

    public function __construct(string $name) {
        $this->ensureValidFormat($name);
        $this->name = $name;
    }

    public function asString(): string {
        return $this->name;
    }

    public function isEqual(ApplicationName $name): bool {
        return $this->name === $name->name;
    }

    private function ensureValidFormat(string $name): void {
        if (!preg_match('#\w/\w#', $name)) {
            throw new InvalidApplicationNameException(
                sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name),
                InvalidApplicationNameException::InvalidFormat
            );
        }
    }
}

Directory Contents

Dirs: 0 × Files: 22

Name Size Perms Modified Actions
504 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
1.15 KB lrw-rw-rw- 2025-09-17 06:53:36
Edit Download
1.27 KB lrw-rw-rw- 2025-09-17 06:53:36
Edit Download
1.02 KB lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
1.13 KB lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
840 B lrw-rw-rw- 2025-09-17 06:53:36
Edit Download
1.16 KB lrw-rw-rw- 2025-09-17 06:53:36
Edit Download
1.25 KB lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
860 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
912 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
8.38 KB lrw-r--r-- 2026-04-26 10:05:32
Edit Download
1.40 KB lrw-rw-rw- 2025-09-17 06:53:36
Edit Download
496 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
764 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
2.54 KB lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
682 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
804 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
424 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
1.09 KB lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
1.19 KB lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
1.16 KB lrw-rw-rw- 2025-09-17 06:53:37
Edit Download
939 B lrw-rw-rw- 2025-09-17 06:53:37
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).